Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void main(){
- FILE * pFile;
- char aircraft_code[4], aircraft_type[61], category[16], wide_body[4], pressurized[4];
- int engines, weight, capacity, pay_load, cruising_speed, range_miles;
- float wing_span, lenght1;
- printf("aircraft code:");
- scanf("%s",&aircraft_code);
- printf("aircraft type:");
- scanf("%s",&aircraft_type);
- printf("engines:");
- scanf("%d",&engines);
- printf("category:");
- scanf("%s",&category);
- printf("wide body:");
- scanf("%s",&wide_body);
- printf("wing_span:");
- scanf("%f",&wing_span);
- printf("lenght1:");
- scanf("%f",&lenght1);
- printf("weight:");
- scanf("%d",&weight);
- printf("capacity:");
- scanf("%d",&capacity);
- printf("pay load:");
- scanf("#d",&pay_load);
- printf("cruising speed:");
- scanf("%d",&cruising_speed);
- printf("range miles:");
- scanf("%d",&range_miles);
- printf("pressurized:");
- scanf("%s",&pressurized);
- pFile = fopen ("aircraft.csv","a");
- if (pFile!=NULL)
- {
- fprintf (pFile, "%s#%s#%d#%s#%s#\\\n", aircraft_code, aircraft_type, engines, category, wide_body);
- fprintf (pFile, "%.2f#%.2f#%d#%d#%d#\\\n",wing_span, lenght1, weight, capacity, pay_load);
- fprintf (pFile, "%d#%d#%s\\\n", cruising_speed, range_miles, pressurized);
- fclose (pFile);
- }
- }
Add Comment
Please, Sign In to add comment