-->
Showing posts with label WAp to enter student's name. Show all posts
Showing posts with label WAp to enter student's name. Show all posts

WAp to enter student's name,his/her address and their roll number using struct. Then display them

//WAp to enter student's name,his/her address and their roll number using struct. Then display them
#include<stdio.h>
#include<conio.h>
struct detail
{
int roll;
char name[100];
char address[100];
}var[100];

void main()
{
int i,j,n;
printf("enter total number of records (less or than '100')\n");
scanf("%d",&n);
printf("now enter records of students\n");
for(i=0;i<n;i++)
{
printf("enter student's roll no.\n");
scanf("%d",&var[i].roll);
printf("enter student's name\n");
scanf("%s",var[i].name);
printf("enter student's address\n");
scanf("%s",var[i].address);
}
printf("entered records are=\n");
  for(i=0;i<n;i++)
{
printf("student's roll=%d, name=%s,student's address=%s \n",var[i].roll,var[i].name,var[i].address);
}
getch();
}