Txerrinko

Introduccion de numero Positivo

Jul 26th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /*
  5.  
  6.  
  7. Pedir la introduccion de un número positivo */
  8.  
  9.  
  10. int main(int argc, char *argv[])
  11. {
  12.   int num;
  13.   printf("Teclea un numero :\n");
  14.   scanf("%d" , &num );
  15.  
  16.   if ( num < 0 ){
  17.        printf("Debería haber introducido un numero positivo \n ");
  18. }
  19.   else if ( num % 10 == 0)
  20. {
  21.   printf("El numero es multiplo de 10\n");
  22. }
  23.  
  24. else
  25. {
  26.     printf("El numero no es multiplo de 10 \n");
  27. }
  28.  
  29.   system("PAUSE"); 
  30.   return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment