Deitel & Deitel, C How to Program 6th Edition, Exercise 9.18 (Reading Strings in Quotes)

// 9.18 (Reading Strings in Quotes)

#include <stdio.h>

int main() {
char string[20];
printf("Enter a word: ");
scanf("%s", string);
printf("The word is: ");
printf("%s\n", string);

printf("Enter a word: ");
scanf("%s", string);
printf("The word is: ");
printf("%s\n", string);

printf("Enter a word: ");
scanf("%s", string);
printf("The word is: ");
printf("%s", string);


printf("\n\n\n");
return 0;

}

OUTPUT

Enter a word: suzy
The word is: suzy
Enter a word: 'suzy'
The word is: 'suzy'
Enter a word: "suzy"
The word is: "suzy"


Press any key to continue . . .

Comments

Popular posts from this blog

Deitel & Deitel, C How to Program 6th Edition, Exercise 6.23 (Turtle Graphics)

Deitel & Deitel, C How to Program 6th Edition, Exercise 6.22 (Total Sales)

Deitel & Deitel, C How to Program 6th Edition, Exercise 5.47 (Craps Game Modification)