User Tools

Site Tools


cplusplus:c_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
cplusplus:c_examples [2020/05/04 00:47] – [C Examples] mithatcplusplus:c_examples [2020/05/04 01:01] mithat
Line 2: Line 2:
 Mithat Konar Mithat Konar
 Derived from //**Differences Between C and C++**// by Robert Niemann \\ Derived from //**Differences Between C and C++**// by Robert Niemann \\
-5/3/2020+2020-05-03
  
 ===== Input/output ===== ===== Input/output =====
Line 18: Line 18:
   int numSpoons = 5;   int numSpoons = 5;
  
-  printf( "I have %d spoons.", numSpoons );+  printf( "I have %d spoons.\n", numSpoons );
      
   return 0;   return 0;
Line 34: Line 34:
     printf( "Please enter a number: " );     printf( "Please enter a number: " );
     scanf( "%d", &num );     scanf( "%d", &num );
-    printf( "You entered %d", num );+    printf( "You entered %d\n", num );
  
     return 0;     return 0;
cplusplus/c_examples.txt · Last modified: 2020/12/07 02:40 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki