home
Learn
screen_rotation
#include <stdio.h> #include <string.h> #include <conio.h> struct student{ char stName[100]; char stMob[15]; char stAddress[300]; }st1,st2; void main(){ 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: Ramesh Kumar Enter mobile number of student: 9971366710 Enter address of student: New Delhi ****************************** Enter name of student: Mohan Kumar Enter mobile number of student: 9717983128 Enter address of student: New Delhi ========student details========== Name of student: Ramesh Kumar Student mobile number: 9971366710 Address of student: New Delhi -------------------------------- Name of student:Mohan Kumar Student mobile number:9717983128 Address of student:New Delhi