Reginaldojs

lista 7,laboratorio,29/10

Oct 29th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4.     struct carro{
  5.            int ano;
  6.            char nome[10];
  7.            };      
  8.     void carroVelho(struct carro fusca){
  9.          if(fusca.ano<1980)  
  10.          printf("velho");
  11.          else
  12.          printf("novo");
  13.     }
  14.     int main(){
  15.         struct carro fusca;
  16.         printf("digite o nome do carro:");
  17.         gets(fusca.nome);
  18.         printf("qual o ano do carro:");
  19.         scanf("%d",&fusca.ano);
  20.         carroVelho(fusca);
  21.         printf("\n\n");
  22.         system ("pause");
  23.         return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment