Translate

Labels

Tuesday, 1 January 2013

STORING THE NAMES IN ARRAY USING C PROGRAM

#include<stdio.h>
#include<conio.h>
void main()
{
char a[10][20];
int i,j;
clrscr();
printf("Enter any names: \n");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%s",a[i]);
printf("Print the names in each line:\n");
for(i=0;i<n;i++)
printf("%s\n",a[i]);
getch();
}

No comments: