Virajsinh

B_PRM_03

Oct 9th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. /* Write a program using structures to read and display
  2. information about a student using typedef. */
  3.  
  4. #include<stdio.h>
  5. #include<conio.h>
  6.  
  7. typedef struct student
  8. {
  9.     int roll;
  10.     char name[15], add[15], city[15];
  11. }stud;
  12.  
  13.  
  14. void main()
  15. {
  16.     stud i;
  17.     clrscr();
  18.  
  19.     printf("Ente Roll :");
  20.     scanf("%d", &i.roll);
  21.     printf("Enter Name :");
  22.     scanf("%s",i.name);
  23.     printf("Enter Address :");
  24.     scanf("%s",i.add);
  25.     printf("Enter City :");
  26.     scanf("%s",i.city);
  27.  
  28.     printf("\n Roll : %d",i.roll);
  29.     printf("\n Name : %s",i.name);
  30.     printf("\n Address : %s",i.add);
  31.     printf("\n City : %s",i.city);
  32.     getch();
  33. }
Add Comment
Please, Sign In to add comment