Advertisement
Nannoka

struct

May 30th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. struct imoveis_IPTU [50] {
  5.     int num_cadastro;
  6.     int meses_atraso;
  7.     float valor_IPTU;
  8.     float valor_multa;
  9.     };
  10.    
  11.  int main () {
  12.     struct imoveis_IPTU imoveis;
  13.     int i;
  14.            
  15.                
  16.         for (i=0;i<50;i++){
  17.            
  18.             fflush (stdin);
  19.             printf ("\nInforme o numero do cadastro: ");
  20.             scanf ("\n%d",&imoveis.num_cadastro);
  21.        
  22.             fflush (stdin);
  23.             printf ("\nInforme o valor do IPTU: ");
  24.             scanf ("%.2f\n",&imoveis.valor_IPTU);
  25.            
  26.             fflush (stdin);
  27.             printf ("\nInforme a quantidade de meses em atraso: ");
  28.             scanf ("%d",&imoveis.meses_atraso);
  29.             imoveis.valor_multa=50.00;
  30.             imoveis.valor_multa=imoveis.valor_multa*imoveis.meses_atraso;
  31.             printf ("\nO imovel com cadastro numero %d pagara %.2f reais de multa.\n",imoveis.num_cadastro,imoveis.valor_multa);
  32.         }
  33.        
  34.        system ("pause");
  35.        return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement