Advertisement
EmanuelEComp

casting

Mar 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. int main (){
  5.     float valor;
  6.  
  7.     printf("Digite o valor: ");
  8.     scanf("%f",&valor);
  9.     if(valor>0){
  10.         if (valor == (int)valor){
  11.             printf("Numero positivo inteiro");
  12.         } else {
  13.             printf("Numero positivo nao inteiro");
  14.     }
  15.     }
  16.     else{
  17.         printf("Numero negativo");
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement