Write a program that will read names of three students from user


#include<stdio.h>
#include<string.h>
int main()
{

int i;
char sname[3][40];
char yourname[40];
for(i=0;i<3;i++)
{
printf(“Enter the name of the student:n”);
gets(yourname);
strcpy(sname[i],yourname);
}
for(i=0;i<3;i++)
{
puts(sname[i]);

}
return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s