/*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

Write a program to print the prime numbers from 1 to 100?

7 Answers  


How do you generate random numbers in C?

0 Answers  


At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E &#133;&#133;.. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with these names could be kept in that shelf as in this example: bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf. All these packets are to be loaded on cars. The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,&#133;&#133;&#133;&#133;.]. Each Car will load the packet with the same alphabet. So, for example, car &#145;A&#146; will load all the packets with name &#145;A&#146;. Each particular car will come at the loading point only once. The cars will come at the loading point in alphabetical order. So, car &#145;B&#146; will come and take all the packets with name &#145;B&#146; from the shelf, then car &#145;C&#146; will come. No matter how deep in the shelf any packet &#145;B&#146; is, all of the &#145;B&#146; packets will be displaced before the &#145;C&#146; car arrives. For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX]. If any shelf is used once, then it could be used again only if it is vacant. Packets from the initial shelf could be unloaded from top only. Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

0 Answers   Infosys,


What is the correct declaration of main?

0 Answers  


SRUCTURE PROGRAMMING

3 Answers   CTS, Wipro,






What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

0 Answers  


What are local static variables? How can you use them?

0 Answers  


What is difference between main and void main?

0 Answers  


What is the scope of global variable in c?

0 Answers  


what is the difference between 123 and 0123 in c?

0 Answers  


What is build process in c?

0 Answers  


what is the maximum no. of bytes calloc can allocate

4 Answers   Mphasis,


Categories