Tuesday, September 15, 2015

C Programming - Scanning and Printing

#include <stdio.h>
#include <conio.h>
int main()
{
                clrscr();
                char adjective[20];
                char food[20];
                char chore[20];
                char furniture[20];
                printf("Enter an adjective:");
                scanf("%s",&adjective);
                printf("Enter a food:");
                scanf("%s",&food);
                printf("entr a household chore (past tense):");
                scanf("%s",&chore);
                printf("Enter an item of furniture:");
                scanf("%s",&furniture);
                printf("\n\nDont touch that %s %s!\n",adjective,food);
                printf("I just %s the %s!\n",chore,furniture);
                getch();
                return(0);
}

Output:  
Dont touch that (adjective) (food)

I just (chore) the (furniture)!

No comments:

Post a Comment