cplusplus:c_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cplusplus:c_examples [2020/05/03 23:07] – [C Examples] mithat | cplusplus:c_examples [2020/12/07 02:40] (current) – [C Examples] mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== C Examples ====== | ====== C Examples ====== | ||
- | adapted from \\ | + | Mithat Konar \\ |
- | **Differences Between C and C++** by Robert Niemann | + | Derived from //**Differences Between C and C++**// by Robert Niemann \\ |
- | 11/22/2015 | + | 2020-05-03 |
===== Input/ | ===== Input/ | ||
Line 18: | Line 18: | ||
int numSpoons = 5; | int numSpoons = 5; | ||
- | printf( "I have %d spoons.", | + | printf( "I have %d spoons.\n", numSpoons ); |
| | ||
return 0; | return 0; | ||
Line 34: | Line 34: | ||
printf( " | printf( " | ||
scanf( " | scanf( " | ||
- | printf( "You entered %d", num ); | + | printf( "You entered %d\n", num ); |
return 0; | return 0; | ||
Line 111: | Line 111: | ||
{ | { | ||
FILE *ptr_file; | FILE *ptr_file; | ||
- | char buf[1000]; | + | char buf[1000]; |
ptr_file = fopen(" | ptr_file = fopen(" |
cplusplus/c_examples.txt · Last modified: 2020/12/07 02:40 by mithat