Advertisement
lucontre

problema 0 pratica 3

May 3rd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7.     int num;
  8.     printf("ingrese entero\n");
  9.     scanf("%i",&num);
  10.     if(num == 0){
  11.         printf("su numero es 0\n");
  12.     }
  13.     else if(num < 0){
  14.         printf("su numero es negativo\n");
  15.         if(pow(num*-1,0.5)*pow(num*-1,0.5) == num){
  16.             printf("su numero es un cuadrado perfecto");
  17.         }
  18.     }
  19.     else if(num > 0){
  20.         printf("su numero positivo\n");
  21.         if(pow(num,0.5)*pow(num,0.5) == num){
  22.             printf("su numero es un cuadrado perfecto");
  23.         }
  24.     }
  25.     else if(num%2 == 0){
  26.         printf("su numero es par\n");
  27.     }
  28.     else if(num%2 != 0){
  29.         printf("su nunmero es inpar\n");
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement