Advertisement
lucontre

practico 3 problema 1

May 3rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 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.    
  11.   do{
  12.     printf("ingrese entero\n");
  13.     scanf("%i",&num);
  14.   }
  15. while(num<1);
  16.    
  17.     else if(num > 0){
  18.         printf("su numero positivo\n");
  19.         if(pow(num,0.5)*pow(num,0.5) == num){
  20.             printf("su numero es un cuadrado perfecto");
  21.         }
  22.     }
  23.     else if(num%2 == 0){
  24.         printf("su numero es par\n");
  25.     }
  26.     else if(num%2 != 0){
  27.         printf("su nunmero es inpar\n");
  28.     }
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement