Tuesday, 9 July 2019

write a program to read a series of words from a terminal using scanf function

#include<stdio.h>
main()
{
char word1[40],word2[40],word3[40],word4[40];
printf("Enter text:\n");
scanf("%s %s %s %s",word1,word2,word3,word4);
printf("\n");
printf("word1=%s\n word2=%s\n word3=%s\n word4=%s",word1,word2,word3,word4);
}

No comments:

Post a Comment