Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- main(){
- int cat=0,imp1=0,imp2=0,ejes=0,total=0;
- FILE * imp1txt = fopen("imp1.txt", "r");
- FILE * imp2txt = fopen("imp2.txt", "r");
- fscanf(imp1txt, "%i", &imp1);
- fscanf(imp2txt, "%i", &imp2);
- printf("Ingrese la categoria: ");
- scanf("%i", &cat);
- printf("\nIngrese cantidad de ejes: ");
- scanf("%i", &ejes);
- if(cat==1){
- total = ejes*imp1;
- printf("\nEl total es %i", total);
- }else{
- total = ejes*imp2;
- printf("\nEl total es %i", total);
- }
- fclose(imp1txt);
- fclose(imp2txt);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement