Advertisement
Guest User

Back to you 1

a guest
Sep 18th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h> 
  2.  
  3. int main()                            
  4. {
  5.     int age;                          
  6.  
  7.     printf( "Please enter your age" );  
  8.     scanf( "%d", &age );  //This will read from stdin and attempt to take the input and place it in an integer variable.              
  9.     if ( age < 100 ) {                  
  10.         printf ("You are pretty young!\n" );
  11.     }
  12.     else if ( age == 100 ) {            
  13.         printf( "You are old\n" );      
  14.     }
  15.     else {
  16.         printf( "You are really old\n" );    
  17.     }
  18.  
  19.   printf("Control structure passed.");
  20.   return 0;
  21. }
  22. //Questions:
  23. //1) What are you using for input?
  24. //2) When you run this one, do you see the last printf?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement