Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- struct PlaneTicket
- {
- char name[100];
- char destination[100];
- float TicketPrice;
- } mahfuz[4];
- mahfuz[0].name = "Monir";
- mahfuz[0].destination = "Bombay";
- mahfuz[0].TicketPrice = 22000.25;
- mahfuz[1].name = "Sharmin";
- mahfuz[1].destination = "Bangkok";
- mahfuz[1].TicketPrice = 12500.75;
- return 0;
- }
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- struct studentInfo
- {
- int studentID;
- char Name[50];
- float CGPA;
- char Major[20];
- } mafz[100];
- for (int i = 1; i <= 2; i++)
- {
- printf("Input Data of Student %d \n", i);
- printf("Input Student ID:\n");
- scanf("%d", &mafz[i-1].studentID);
- printf("Input Student Name:\n");
- //scanf("%[^\n]%*c", &mafz[i].Name);
- gets(mafz[i-1].Name);
- printf("Input Student CGPA:\n");
- scanf("%f", &mafz[i-1].CGPA);
- printf("Input Student Major:\n");
- //scanf("%[^\n]%*c", &mafz[i].Major);
- gets(mafz[i-1].Major);
- }
- //printf("%s", mafz[0].Name);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement