Advertisement
luizaspan

introfiscomp - lista1 - questao18

Apr 13th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. // QUESTÃO 18
  2. // 18. Verficar se um inteiro é positivo ou negativo.
  3.  
  4.  
  5. #include <stdio.h>
  6. #include <math.h>
  7.  
  8. int main(void)
  9. {
  10.  
  11.   int a;
  12.   printf("\nDigite um número inteiro: ");
  13.   scanf("%d",&a);
  14.  
  15.   if(a>0)
  16.     {
  17.       printf("\nO número %d é positivo.\n\n",a);
  18.     }
  19.  
  20.   else
  21.     {
  22.       printf("\nO número %d é negativo.\n\n",a);
  23.     }
  24.  
  25. }
  26.  
  27. // FUNCIONA!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement