Advertisement
ZinedinZidan

struct2

Dec 2nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. struct person
  4. {
  5.   int age;
  6.   float salary;
  7. };
  8.  
  9. struct person person1,person2;
  10.  
  11. int main()
  12. {
  13.     struct person person1,person2;
  14.     person1.age = 25;
  15.     person1.salary =22239.50;
  16.    
  17.     printf("Person1 : \n");
  18.     printf("Age = %d\n",person1.age);
  19.     printf("Salary = %.2f\n",person1.salary);
  20.    
  21.     person2.age = 20;
  22.     person2.salary =20000.50;
  23.    
  24.     printf("Person2 : \n");
  25.     printf("Age = %d\n",person2.age);
  26.     printf("Salary = %.2f\n",person2.salary);
  27.    
  28.    
  29.     getch();
  30.    
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement