Structure in C

assignmment 3.html
#include<stdio.h>
struct students
{
	int ROLL_NO;
	char name[50];
	char address[50];
	
};
struct students s[50];
int main()
{
	int i;
	for(i=0;i<50;i++)
	{
	printf("\nEnter the roll no. of std %d:\t",i+1);
	scanf("%d",&s[i].ROLL_NO);
	
	printf("\n Enter the name of std %d:\t",i+1);
	scanf("%s",s[i].name);
	
	printf("\nEnter the address of std %d:\t",i+1);
	scanf("%s",s[i].address);
	
	}
	for(i=0;i<50;i++)
	{
	printf("\nEntered roll no. of std %d is :\t%d\t",i+1,s[i].ROLL_NO);
	printf("\n Entered  name of std %d is : \t%s",i+1,s[i].name);
	printf("\nEntered address of std %d is:\t %s",i+1,s[i].address);
	
	}
	getch();
	return 0;
}

0 Comments