Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main(){
- int vent,tarj;
- char codigo;
- float total,contador,result,iva;
- vent=tarj=contador=0;
- printf("Ingresa el codigo: ");
- fflush(stdin);
- scanf("%c",&codigo);
- if (codigo == 'F')
- {}
- else
- {
- printf("Ingresa el importe total: ");
- fflush(stdin);
- scanf("%f",&total);
- }
- system("clear");
- while(codigo!='F')
- {
- if(codigo=='C')
- {
- result=(70*total)/100;
- vent++;
- contador+=result;
- system("clear");
- }
- else
- {
- if(codigo=='E')
- {
- result=(90*total)/100;
- vent++;
- contador+=result;
- system("clear");
- }
- else
- {
- if(codigo=='T')
- {
- result=((total*12)/100)+total;
- vent++;
- tarj++;
- contador+=result;
- system("clear");
- }
- }
- }
- printf("Ingresa el codigo: ");
- fflush(stdin);
- scanf("%c",&codigo);
- if (codigo == 'F')
- {}
- else
- {
- printf("Ingresa el importe total: ");
- fflush(stdin);
- scanf("%f",&total);
- }
- system("clear");
- }
- iva=(21*contador)/100;
- printf("----------------------------\n");
- printf("\n Efectivo en caja: %.2f\n Ventas con tarjeta: %d\n Total de ventas: %d\n Importe del IVA: %.2f\n",contador,tarj,vent,iva);
- printf("\n----------------------------");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement