Advertisement
matheusfreitag

1037

Dec 23rd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main (){
  6.      
  7.     double n,a,b,c,d;
  8.     scanf ("%lf", &n);
  9.    
  10.     a = 25.0000;
  11.     b = 50.0000;
  12.     c = 75.0000;
  13.     d = 100.0000;
  14.  
  15.  
  16. if (a<0){
  17.     printf ("Fora do intervalo\n");
  18.     }  
  19.    
  20. else{
  21.        
  22.    
  23.     if (n<=a){
  24.         printf ("Intervalo [0,25]\n");
  25.     }
  26.     else{
  27.         if (n<=b){
  28.             printf ("Intervalo (25,50]\n");
  29.         }
  30.         else{
  31.             if (n<=c){
  32.                 printf ("Intervalo (50,75]\n");
  33.             }
  34.             else{
  35.                 if(n<=d){
  36.                     printf ("Intervalo (75,100]\n");
  37.                 }
  38.                 else{
  39.                     printf ("Fora do intervalo\n");
  40.                 }
  41.             }
  42.         }
  43.     }
  44.    
  45. }    
  46.    
  47.    
  48.    
  49.    
  50.    
  51.    
  52.    
  53.    
  54.    
  55.    
  56.     return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement