INPUT IN STRUCTURE FOR STUDENT RECORDS

#include<stdio.h>
#include<conio.h>
struct student
{
  int rno;
  char name[20];
  int age;
};
struct student s1;
void main()
{
 clrscr();
 printf("\n\tEnter roll number ");
 scanf("%d",&s1.rno);
 printf("\n\t Enter name ");
 scanf("%s",&s1.name);
 printf("\n\t Enter age ");
 scanf("%d",&s1.age);

 printf("\nStudent Details");
 printf("\nRoll Number=%d",s1.rno);
 printf("\nName = %s",s1.name);
 printf("\nAge = %d",s1.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...