Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IFF - Introdução à Programação
- //Lista de Exercícios - 65
- #include<stdio.h>
- #include<locale.h>
- int main(){
- setlocale(LC_ALL,"Portuguese");
- int quantidade[500],check=0;
- float preco[500], total;
- for (int i=0;i<500;i++){
- if (check==0){
- printf("Entre com a preço do produto, seguido de sua quantidade: R$");
- scanf("%f%d",&preco[i],&quantidade[i]);
- total+=preco[i]*quantidade[i];
- }
- if((check==0)&&(i==499)){
- check=1;
- i=0;
- }
- if (check==1){
- printf("O valor arrecadado com o %dº produto foi R$%.2f.\n",i+1,preco[i]*quantidade[i]);
- }
- }
- printf("O valor total foi de R$%.2f", total);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment