C program to display entered names using array

#include<stdio.h>
int main()
{
 int i,n;
 char a[100][25];
 printf("Enter the number:-  ");
 scanf("%d",&n);
 printf("Enter the names in array\n");
 for(i=0;i<n;i++)
 {
  scanf("%s",a[i]);
 }
 printf("\nThe names you have entered is:-\n");
 for (i=0;i<n;i++)
 {
  printf("%s\n",a[i]);
 }
}

OUTPUT

C program to display entered names using array

Post a Comment

0 Comments