URI Online Judge Solution 1048 - Solution in C










Solution in C

#include<stdio.h>
int main()
{
float n,sum,sum1;
scanf("%f",&n);
if(0<=n&&n<=400.00)
{
sum=(n*15)/100;
sum1=n+sum;
printf("Novo salario: %.2f\n",sum1);
printf("Reajuste ganho: %.2f\n",sum);
printf("Em percentual: 15 %\n");
}
else if(400.01<=n&&n<=800.00)
{
sum=(n*12)/100;
sum1=n+sum;
printf("Novo salario: %.2f\n",sum1);
printf("Reajuste ganho: %.2f\n",sum);
printf("Em percentual: 12 %\n");
}
else if(800.01<=n&&n<=1200.00)
{
sum=(n*10)/100;
sum1=n+sum;
printf("Novo salario: %.2f\n",sum1);
printf("Reajuste ganho: %.2f\n",sum);
printf("Em percentual: 10 %\n");
}
else if(1200.01<=n&&n<=2000.00)
{
sum=(n*7)/100;
sum1=n+sum;
printf("Novo salario: %.2f\n",sum1);
printf("Reajuste ganho: %.2f\n",sum);
printf("Em percentual: 7 %\n");
}
else
{
if(n>2000.00)
{
sum=(n*4)/100;
sum1=n+sum;
printf("Novo salario: %.2f\n",sum1);
printf("Reajuste ganho: %.2f\n",sum);
printf("Em percentual: 4 %\n");
}
}
return 0;
}





~~~~~~Happy Coding~~~~~~

No comments

Powered by Blogger.