Guest User

Untitled

a guest
Feb 18th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() /* Most important part of the program!
  4. */
  5. {
  6. int age; /* Need a variable... */
  7.  
  8. printf( "Please enter your age" );/* Asks for age */
  9. getchar(); /* hangs proggy */
  10. scanf( "%d", &age ); /* The input is put in age */
  11. if ( age < 100 ) { /* If the age is less than 100 */
  12. printf ("You are pretty young!\n" ); /* Just to show you it works... */
  13. }
  14. else if ( age == 100 ) { /* I use else just to show an example */
  15. printf( "You are old\n" );
  16. }
  17. else {
  18. printf( "You are really old\n" ); /* Executed if no other statement is
  19. */
  20. }
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment