ARRAYS OF STRUCTURE

#include<stdio.h>
#include<conio.h>
struct student
{
  int rno;
  char name[20];
  int age;
};
//arrays of structure
struct student s1[2];
void main()
{
int i;
 clrscr();
 for(i=0;i<=1;i++)
 {
 printf("\n\t Enter roll number ");
 scanf("%d",&s1[i].rno);
 printf("\n\t Enter name ");
 scanf("%s",&s1[i].name);
 printf("\n\t Enter age ");
 scanf("%d",&s1[i].age);
 }
 printf("\n Student Details");
 for(i=0;i<=1;i++)
 {
 printf("\nRoll Number=
 %d",s1[i].rno);
 printf("\n Name = %s",s1[i].name);
 printf("\n Age = %d",s1[i].age);
 }
 getch();

}
Output

No comments:

Post a Comment

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II :   1) Which of the following is the extension of Not...