Advertisement
zaman360live

Fix it 😳

Sep 11th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main()
  5. {
  6. struct PlaneTicket
  7. {
  8. char name[100];
  9. char destination[100];
  10. float TicketPrice;
  11. } mahfuz[4];
  12. mahfuz[0].name = "Monir";
  13. mahfuz[0].destination = "Bombay";
  14. mahfuz[0].TicketPrice = 22000.25;
  15. mahfuz[1].name = "Sharmin";
  16. mahfuz[1].destination = "Bangkok";
  17. mahfuz[1].TicketPrice = 12500.75;
  18. return 0;
  19. }
  20.  
  21.  
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <string.h>
  25. int main()
  26. {
  27. struct studentInfo
  28. {
  29. int studentID;
  30. char Name[50];
  31. float CGPA;
  32. char Major[20];
  33. } mafz[100];
  34.  
  35. for (int i = 1; i <= 2; i++)
  36. {
  37. printf("Input Data of Student %d \n", i);
  38.  
  39. printf("Input Student ID:\n");
  40. scanf("%d", &mafz[i-1].studentID);
  41. printf("Input Student Name:\n");
  42. //scanf("%[^\n]%*c", &mafz[i].Name);
  43. gets(mafz[i-1].Name);
  44. printf("Input Student CGPA:\n");
  45. scanf("%f", &mafz[i-1].CGPA);
  46. printf("Input Student Major:\n");
  47. //scanf("%[^\n]%*c", &mafz[i].Major);
  48. gets(mafz[i-1].Major);
  49. }
  50. //printf("%s", mafz[0].Name);
  51. return 0;
  52. }
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement