Sunday, April 13, 2014

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:
");

scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%s",a[i]);
printf("Print the names in each line:
");

for(i=0;i<n;i++)
printf("%s
",a[i]);

getch();
}

Related Post:

0 comments:

Post a Comment

 
Powered by Blogger .
Converted To Blogger Template by Anshul .