Hi,
First of all please check the conditions but as far as i understand the conditions the program would be like this-
#include<stdio.h>
#include<conio.h>
void main()
{
int salary,bonus,totalsalary,hours;
printf("enter salary");
scanf("%d",&salary);
printf("enter hours");
scanf("%d",&hours);
if(hours<45 && hours>=40)
{
bonus=500;
}
else
{
if(hours<40 && hours>=35)
{
bonus=300;
}
else
{
if(hours<=30 && hours>20)
{
bonus=150;
}
else
{
bonus=0;
}
}
}
totalsalary=salary+bonus;
printf("Salary=%d",salary);
printf("Bonus=%d",bonus);
printf("Total Salary=%d",totalsalary);
getch();
}
But the conditiosn given by you are not seems to be correct.Just correct the conditions value if wrong and run the program
Thanks!
mannu_rakesh
#include
Bket gnun .. pumapatong ung ELSE sa IF ko !
4,036 views
Usually answered in minutes!
×