Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new

 Categories >> Software >> Programming Languages >> C

 C Interview Questions (2248) C++ Interview Questions (1106) VC++ Interview Questions (342) Delphi Interview Questions (510) Programming Languages AllOther Interview Questions (644)
Question
```WAP to accept basic salary of an employee?
Calculate it HRA=25%,DA=30%,PF=30%&net salary display all
contents?```
Question Submitted By :: Don
I also faced this Question!!     Rank Answer Posted By

Re: WAP to accept basic salary of an employee? Calculate it HRA=25%,DA=30%,PF=30%&net salary display all contents?
# 1
#include<stdio.h>
void main()
{
long int bs,da,hra,pf;
printf("\nEnter The Basic Salary of Employee: ");
scanf("%d",&bs);
printf("\nDA : %d",da=bs*30/100);
printf("\nHRA : %d",hra=bs*25/100);
printf("\nPF : %d",pf=bs*30/100);
printf("\nNet Salary: %d",da+hra+pf);
}

Hey frnds pls tell me is it a ryt answer or wrong?
Help me out

 Is This Answer Correct ? 39 Yes 16 No
Don

Re: WAP to accept basic salary of an employee? Calculate it HRA=25%,DA=30%,PF=30%&net salary display all contents?
# 2
the program does not yield proper result, cos long int is
used and then only "%d", instead just use "%ld" like i did
in following
"#include<stdio.h>
void main()
{
long int bs,da,hra,pf;
printf("\nEnter The Basic Salary of Employee: ");
scanf("%ld",&bs);
printf("\nDA : %ld",da=bs*30/100);
printf("\nHRA : %ld",hra=bs*25/100);
printf("\nPF : %ld",pf=bs*30/100);
printf("\nNet Salary: %ld",da+hra+pf);
}

 Is This Answer Correct ? 17 Yes 14 No
Yarmia Anuj Kalundia

Re: WAP to accept basic salary of an employee? Calculate it HRA=25%,DA=30%,PF=30%&net salary display all contents?
# 3
wrong
 Is This Answer Correct ? 7 Yes 3 No
Balachander

Re: WAP to accept basic salary of an employee? Calculate it HRA=25%,DA=30%,PF=30%&net salary display all contents?
# 4
IF UR BASIC SALARY 5000 RS.
HRA=B*25/100;
HRA=1250;
DA=BS*30/100;
DA=1500;
PF=BS*30/100;
PF=1500;
NET SALARY=HRA+DA+PF+BS;
NET SALARY=1250+1500+1500+5000;
NET SALARY= 9250 RS.

 Is This Answer Correct ? 22 Yes 11 No
Sanjay

Re: WAP to accept basic salary of an employee? Calculate it HRA=25%,DA=30%,PF=30%&net salary display all contents?
# 5
My question is that, my salary is Rs. 12,000/-. In my
salary, How can calculate the Basic, DA, HRA and other
conveyance allowancs. This is for the PF. Please send the
detaisl and examples to me at the earleist. Hope for the
same.

Thanks

Salim Kumar A.P.

 Is This Answer Correct ? 8 Yes 7 No
Salim Kumar A.p.

Re: WAP to accept basic salary of an employee? Calculate it HRA=25%,DA=30%,PF=30%&net salary display all contents?
# 6
jst add basic into net salary with da n hra n pf
 Is This Answer Correct ? 2 Yes 7 No
Brijesh

  Question Asked @ Answers Other C Interview Questions any string of bits of length 'n' represents a unique non- negative integer between.............? 2 struct node {struct node*temp,*new} prinf("%d",sizeof(struct node)); 2 How can we open a file in Binary mode and Text mode?what is the difference? PanTerra 1 Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array. 6 which operator having lowest precedence?? a.)+ b.)++ c.)= d.)% 4 Hi Every one...........I have been selected for the SBI Clerk. But i m one month Pregnanat. So anyone please suggest me, is they take any objection on my joining . State-Bank-Of-India-SBI 4 do u print this format '(((())))'. This brackets is based on user input like 4 or 5 or 6,without using any loop's? Oracle 1 what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above Accenture 3 main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); } 2 how to write a prog in c to convert decimal number into binary by using recursen function, 1 Difference between for loop and while loop? 1 how can you print&scan anything using just one character? :) HINT: printf,scanf similer 2 For more C Interview Questions Click Here