sl.   

Basic

%

Lowest house  rent

1.       

0 - 3000

60%

1200

2.       

3001 - 6000

50%

2250

3.       

More than 6000

40%

3259

#include<stdio.h>
#include<conio.h>
void main ( ) {
float basic, h_rent;
printf("\nGive the basic = ");
scanf("%f",&basic);
if(basic >=0&& basic <=3000){
if (basic*0.60 < 1200)
{
h_rent = 1200;
}
else
{
h_rent = basic*0.6;
}
}
if(basic >3000 && basic <=6000){
if (basic*0.50 < 2200)
{
h_rent = 2200;
}
else
{
h_rent = basic*0.50;
}
}
if(basic >6000){
if (basic*0.40 < 3250)
{
h_rent = 3250;
}
else
{
h_rent = basic*0.40;
}
}
printf("\nBasic:%5.2f\nHouseRent:%5.2f",basic,h_rent);
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *