home
Learn
screen_rotation
#include <stdio.h> #include <string.h> #include <conio.h> struct student{ char stName[100]; char stMob[15]; char stAddress[300]; }; void main(){ struct student st1,st2; clrscr(); puts("Enter name of student:"); gets(st1.stName); puts("Enter mobile number of student:"); gets(st1.stMob); puts("Enter address of student:"); gets(st1.stAddress); printf("\n******************************\n"); puts("Enter name of student:"); gets(st2.stName); puts("Enter mobile number of student:"); gets(st2.stMob); puts("Enter address of student:"); gets(st2.stAddress); printf("\n========student details=========="); printf("\nName of student: "); printf(st1.stName); printf("\nStudent mobile number: "); printf(st1.stMob); printf("\nAddress of student: "); printf(st1.stAddress); printf("\n--------------------------------"); printf("\nName of student:"); printf(st2.stName); printf("\nStudent mobile number:"); printf(st2.stMob); printf("\nAddress of student:"); printf(st2.stAddress); getch(); }
Program Output
Enter name of student: Rahul Kumar Enter mobile number of student: 9971366710 Enter address of student: New Delhi, India ****************************** Enter name of student: Krishna Kumar Enter mobile number of student: 9717983128 Enter address of student: Buxar, India ========student details========== Name of student: Rahul Kumar Student mobile number: 9971366710 Address of student: New Delhi, India -------------------------------- Name of student:Krishna Kumar Student mobile number:9717983128 Address of student:Buxar, India