pastebin

Paste Search Dynamic
Recent pastes
Person
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<stdlib.h>
  4. struct Person
  5. {
  6. char name[50];
  7. int age;
  8. float salary;
  9. };
  10.  
  11. int main()
  12. { int i;
  13. struct Person person[4];
  14. for(i=0;i<4;i++)
  15. {
  16. printf("Enter the information of %d person : n",i+1);
  17. printf("Enter the name :  ");
  18. fflush(stdin);
  19. gets(person[i].name);
  20. printf("Enter the age : ");
  21. scanf("%dn",&person[i].age);
  22. printf("Enter the salary : ");
  23. scanf("%fn",&person[i].salary);
  24. printf("n");
  25. }
  26. for(i=0;i<4;i++)
  27. {
  28.  
  29. printf("%d person information",i+1);
  30. printf("Name : %sn",person[i].name);
  31. printf("Age : %dn",person[i].age);
  32. printf("Salary : %fn",person[i].salary);
  33. printf("n");
  34. }
  35. return 0;
  36. }
  37.  
Parsed in 0.011 seconds