/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/
#include<stdio.h>
main()
{
float x;
scanf("%f",&x);
if(x<0||x>100)
{
printf("Fora de intervalo\n");
}
else if(x>=0&&x<=25)
{
printf("Intervalo [0,25]\n");
}
else if(x>=25&&x<=50)
{
printf("Intervalo (25,50]\n");
}
else if(x>=50&&x<=75)
{
printf("Intervalo (50,75]\n");
}
else if(x>=75&&x<=100)
{
printf("Intervalo (75,100]\n");
}
else
printf("Fora de intervalo\n");
return 0;
}
//Happy_Coding
#include<stdio.h>
main()
{
float x;
scanf("%f",&x);
if(x<0||x>100)
{
printf("Fora de intervalo\n");
}
else if(x>=0&&x<=25)
{
printf("Intervalo [0,25]\n");
}
else if(x>=25&&x<=50)
{
printf("Intervalo (25,50]\n");
}
else if(x>=50&&x<=75)
{
printf("Intervalo (50,75]\n");
}
else if(x>=75&&x<=100)
{
printf("Intervalo (75,100]\n");
}
else
printf("Fora de intervalo\n");
return 0;
}
//Happy_Coding
No comments:
Post a Comment