ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2265)
 C++ interview questions  C++ Interview Questions (1119)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (648)
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 :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 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 ?    44 Yes 17 No
Don
 
Answer
# 2
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.
THIS IS MY CORRECT ANSWER
 
Is This Answer Correct ?    23 Yes 13 No
Sanjay
 
 
 
Answer
# 3
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 ?    18 Yes 15 No
Yarmia Anuj Kalundia
 
Answer
# 4
wrong 
Is This Answer Correct ?    7 Yes 4 No
Balachander
 
Answer
# 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 8 No
Salim Kumar A.p.
 
Answer
# 6
jst add basic into net salary with da n hra n pf 
Is This Answer Correct ?    2 Yes 8 No
Brijesh
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is the difference between declaring a variable by constant keyword and #define ing that variable?   1
What is Bitwise Operator and how it works?   1
how to find turn around time in operating system?   3
write a program for egyptian fractions in c? Satyam 1
Average of a couple 10 years ago was 25. The average remains same after having a child and twins after 3 years. What is the present age of the first child IBM 10
what is the output of printf("%d",(scanf("%d",10));   10
What is the purpose of the code, and is there any problem with it? unsigned int f( unsigned n ) { return n & 7; } google 1
How can I read a directory in a C program? Wipro 2
what is constant pointer?   3
how many argument we can pas in in a function CTS 25
how 2 compile & execute c program with out using editor? HP 2
how to swap two integers 1 and 32767 without using third variable Microsoft 10
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com