Code:
#include <stdio.h>
int main(){
char word1[80],word2[80];
memset(word1,0x00,sizeof(word1));
memset(word2,0x00,sizeof(word2));
printf("enter two words: ");
scanf("%s %s",word1,word2);
printf("word1=%s word2=%s \n",word1,word2);
return 0;
}
This reads two "words" separated by spaces from stdin (the keyboard in this case).
scanf is NOT a safe function because it does not check the size of the data item being input. scanf usage in older programs is a source of vulnerability.