#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
int main ()
{
char word[100][21] ;
puts( "Enter Your Words" );
puts( "Enter STOP To Get Your Results" );
while( strcmp( word, "STOP" ) )
{
scanf( "%20s", word );
}
return 0;
}
After I scan in a word id like to store it into an array called storing[][], but I dont know how to achieve that, and also I dont want to store the terminating STOP word
whileloop. Try usingdo {} whileloop instead. Alsowordis a multidimensional array. You could doscanf("%20s", word[0])for instance but usingwordalone isn't correct.word[]. posted code tries to compare contents ofwordwith some string that has not yet been input. Posted code fails to check returned value (not parameter value) fromscanf()to assure the operation was successful#definestatements and then use those meaningful names throughout the code.word[x[buffer. Then incrementxin preparation for the next loop. You might want to make use of thefor()statement for handling the variablex.