Answer to Question #177989 in C for Arslan Habib

Question #177989

Q#1 Write a C program to accept the height of a person in centimeter and categorize the person according to their height.(IF-ELSE IF)

  HEIGHT < 150 = Dwarf

HEIGHT = 150 = Average height.

HEIGHT > = 165 = TALL.

Q#2 Write a program to make decision for the employees ‘salary as under:

Employees’ salary HRA added to the salary DA

Less than Rs. 5000 20% of basic salary of HRA 90% of basic salary DA

Equal to Rs. 5000 or above Rs. 2000 will be added of HRA 95% of basic salary DA


Take input of the employee salary and find the gross salary of the employee based on above conditions.

NOTE: HRA is House Rent Allowance , DA is Dearness Allowance



1
Expert's answer
2021-04-03T14:34:51-0400
#include <stdio.h>
int main()
{
float HEIGHT;
printf("input the height of the person in centimeters:");
  scanf("%f", &HEIGHT);
if(HEIGHT<150.0){
printf("The person is Dwarf.\n");
}
else if((HEIGHT>=150.0) && (HEIGHT<165.0))
{
	


printf("The person is average heighted.\n");


}
else if ((HEIGHT>=165.0) && (HEIGHT<=195.0))
{
	


printf("The person is taller.\n");
}
else{
printf("The height is out of range.\n");
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS