WAP to accept basic salary of an employee?
Calculate it HRA=25%,DA=30%,PF=30%&net salary display all
contents?
Answer Posted / yarmia anuj kalundia
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 ? | 20 Yes | 17 No |
Post New Answer View All Answers
What is scanf_s in c?
Can you mix old-style and new-style function syntax?
What is the sizeof () operator?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What 'lex' does?
What are header files why are they important?
What is static volatile in c?
What is union and structure in c?
State the difference between realloc and free.
Differentiate between full, complete & perfect binary trees.
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Explain what is wrong with this program statement? Void = 10;
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What is static and auto variables in c?
What is dynamic variable in c?