Advertisement
gtw7375

Questao 3 - Sidney

Sep 27th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. int calculo(int numero){
  2.    
  3.     if(numero %2==0){
  4.             printf("\n O valor digitado e par: %d \n \n", numero);
  5.    
  6.             numero *= 5;
  7.        
  8.             printf("Multiplicando por 5, fica: %d ", numero);
  9.     } else {
  10.        
  11.             printf("\n O valor digitado e impar: %d \n \n", numero);
  12.    
  13.             numero *= 3;
  14.        
  15.             printf("Multiplicando por 3, fica: %d \n", numero);
  16.     }
  17.    
  18. }
  19.  
  20. main(){
  21.    
  22.     int valor;
  23.    
  24.     printf("Digite um numero:");
  25.     scanf("%d", &valor);
  26.    
  27.     calculo(valor);
  28.    
  29.     getch();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement