// C program to store words in an array
#include <stdio.h>
int main()
{
int i;
// Lets say we have 3 words
int n = 4;// 1st word ---
// 2nd word ---
// 3rd word ---
// Declaration of 2-D char array
char array[n][20]; // row -> | coloumn -> --
// Initialization of 2-D char array
for (i = 0; i < 4; i++)
scanf("%s", array[i]);
// print the words
for (i = 0; i < 4; i++)
printf("%s ", array[i]);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: