Advertisement
tonygms3

practice_structure

Feb 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. struct student{
  5.     char name[50];
  6.     int age;
  7.     double height;
  8.     };
  9.  
  10. int main()
  11. {
  12.     struct student first;
  13.     //first.name;
  14.  
  15.     scanf("%d",&first.age);
  16.     scanf("%lf",&first.height);
  17.     fgets(first.name,50,stdin);
  18.     //printf("%s",name);
  19.  
  20.     printf("name of the student is : %s\n",first.name);
  21.     printf("his age is %d and height is %.2lf",first.age,first.height);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement