Write A Program To Display The Information About A Student Using Structure
Write A Program To Display The Information About A Student Using Structure
Output:
};
Struct student s1;
Clrscr();
Printf(\n enter the data of a s1);
Scanf(%%d%f,&s1.name,&s1.roll,&s1.fee);
Printf(\n name=%s,s1 name);
Printf(\n roll=%d,s1 roll);
Print(\n fee=%f,s1 fee);
Printf(\n enter the data of d1);
Scanf(%d%d%d,&d1.day,&d1.month,&d1.year);
Printf(\n day=%d,d1 day);
Printf(\n month=%d,d1 month);
Printf(\n year=%d,d1 year);
Getch();
}
Output
Enter the data of a student
Enter the name: jasvir aujla
Enter the roll no: 01
Enter the fee: 22000
Enter the date of birth day month year: 16 12 92
Record of a student is
printf(\n rollno=%d,s1[i].rollno);
}
getch();
Output:
enter the data of student:
sangrur 1 2 3 4 5
name= ram
address=dhuri
rollno=1
name=sham
adderss=sunam
rollno=2
name=mohan
address=patran
rollno=3
name =sharma
address=barnala
rollno=4
name=jot
address=sangrur
rollno=5
Void main( )
{
struct student
{
Char name[20];
Int rollno;
Int marks[5];
};
Struct student s1;
Clrscr();
Int i;
Printf(\n entrt thr data of s1);
Scanf(%s%d,&s1.name,&s1.rollno);
For(i=0;i<=4;i++)
{
Scanf(%d,&s1.marks[i]);
}
Printf(\n name=%S,s1 name);
Printf(\n rollno=%d,s1 rollno);
For(i=0;i<=4;i++)
{
Printf(\n marks=%d,S1 marks);
}
Getch();
}
Output:
56
89
78
99
getch();
output:
the value of i=5
the address of i=2002
the address of i=2002
the value of i= 5