Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int age;
- printf( "Please enter your age" );
- scanf( "%d", &age ); //This will read from stdin and attempt to take the input and place it in an integer variable.
- if ( age < 100 ) {
- printf ("You are pretty young!\n" );
- }
- else if ( age == 100 ) {
- printf( "You are old\n" );
- }
- else {
- printf( "You are really old\n" );
- }
- printf("Control structure passed.");
- return 0;
- }
- //Questions:
- //1) What are you using for input?
- //2) When you run this one, do you see the last printf?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement