Advertisement
Lazyfoot

Desconto

Oct 31st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6. int main(int argc, char *argv[]) {
  7.     float compra;
  8.     printf("Entre com o valor total da compra\n");
  9.     scanf("%f",compra);
  10.     if(compra>100){
  11.         compra=compra*0.9;
  12.         printf("Preço com desconto: %d\n",compra);
  13.     }
  14.     else{
  15.         printf("Não a desconto.");
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement