/*program to calculate hra,da in salary if salary less than
10000 then hra15%,da13% otherwise hra20%,da18%/*

Answers were Sorted based on User's Feedback



/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20..

Answer / riteshvk007

#include<stdio.h>
#include<conio.h>
void main()
{
int bs,da,hra;
clrscr();
printf("\n enter the basic salary of employee");
scanf("%d",&bs);
if (bs>10000)
{
printf("\n da : %d",da=bs*15/100);
printf("\n hra : %d",hra=bs*13/100);
printf("\n net salary: %d",da+hra);
}
else
{
printf("\n da : %d",da=bs*20/100);
printf("\n hra : %d",hra=bs*18/100);
printf("\n net salary: %d",da+hra);
}
getch();
}

plese cheackout mistakes i can't run successfully this program

Is This Answer Correct ?    16 Yes 4 No

/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20..

Answer / rama krishna sidhartha

#include<stdio.h>
#include<conio.h>
void main()
{
long int bs,da,hra;
clrscr();
printf("\n enter the basic salary of employee=");
scanf("%f",&bs);
if (bs<10000)
{
printf("\n da : %f",da=(bs*15)/100);
printf("\n hra : %f",hra=(bs*13)/100);
printf("\n net salary: %f",da+hra);
}
else
{
printf("\n da : %f",da=(bs*20)/100);
printf("\n hra : %f",hra=(bs*18)/100);
printf("\n net salary: %f",da+hra);
}
getch();
}

Is This Answer Correct ?    11 Yes 0 No

/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20..

Answer / swapnil

#include<stdio.h>
#include<conio.h>
void main()
{
float bs,da,hra;
clrscr();
printf("\n enter the basic salary of employee=");
scanf("%f",&bs);
if (bs<10000)
{
printf("\n da : %f",da=(bs*15)/100);
printf("\n hra : %f",hra=(bs*13)/100);
printf("\n net salary: %f",da+hra);
}
else
{
printf("\n da : %f",da=(bs*20)/100);
printf("\n hra : %f",hra=(bs*18)/100);
printf("\n net salary: %f",da+hra);
}
getch();
}

Is This Answer Correct ?    4 Yes 0 No

/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20..

Answer / parmeshwar

#include<stdio.h>
#include<conio.h>
void main()
{
long int bs,da,hra;
clrscr();
printf("\n enter the basic salary of employee=");
scanf("%f",&bs);
if (bs<10000)
{
printf("\n da : %f",da=(bs*15)/100);
printf("\n hra : %f",hra=(bs*13)/100);
printf("\n net salary: %f",da+hra);
}
else
{
printf("\n da : %f",da=(bs*20)/100);
printf("\n hra : %f",hra=(bs*18)/100);
printf("\n net salary: %f",da+hra);
}
getch();
}

Is This Answer Correct ?    2 Yes 0 No

/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20..

Answer / swapnil

#include<stdio.h>
#include<conio.h>
void main()
{
int bs,da,hra;
clrscr();
printf("\n enter the basic salary of employee");
scanf("%d",&bs);
if (bs<10000)
{
printf("\n da : %d",da=bs*15/100);
printf("\n hra : %d",hra=bs*13/100);
printf("\n net salary: %d",da+hra);
}
else
{
printf("\n da : %d",da=bs*20/100);
printf("\n hra : %d",hra=bs*18/100);
printf("\n net salary: %d",da+hra);
}
getch();
}

Is This Answer Correct ?    4 Yes 3 No

/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20..

Answer / swapnilkumar

3 no solution is correct please run this code u will get result

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

Who is the main contributor in designing the c language after dennis ritchie?

0 Answers  


#include<stdio.h> int main() { int i=2; int j=++i + ++i + i++; printf("%d\n",i); printf("%d\n",j); }

15 Answers   Infosys,


What does *p++ do? What does it point to?

0 Answers  


Which header file should you include if you are to develop a function which can accept variable number of arguments?

0 Answers   TCS, TISL,


What are the types of unary operators?

0 Answers  






What is the right type to use for boolean values in c?

0 Answers  


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

0 Answers  


Are c and c++ the same?

0 Answers  


who is the founder of c

19 Answers   College School Exams Tests, HP,


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

0 Answers  


What is use of bit field?

0 Answers  


main() { int i; printf("%d",scanf"%d",&i))//if the input is 12 24 34 then wat will be the output }

2 Answers  


Categories