I wrote this program where the user enter a string n
times according to his wish, but I am struggling to print all of the strings that have been read. As it stands, the program just prints the last entered string.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, count=0;
char string[10];
printf("Enter the value of n\n");
scanf("%d", &n);
//printf("Enter the words\n");
while(count<n)
{
scanf("%s", string);
count++;
}
printf("The strings that you entered are\n");
*// I want to print all the strings that I took as input from scanf*
}