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


Please Help Members By Posting Answers For Below Questions

What is scanf_s in c?

635


Can you mix old-style and new-style function syntax?

666


What is the sizeof () operator?

626


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

638


What 'lex' does?

723






What are header files why are they important?

586


What is static volatile in c?

580


What is union and structure in c?

622


State the difference between realloc and free.

641


Differentiate between full, complete & perfect binary trees.

675


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

622


Explain what is wrong with this program statement? Void = 10;

768


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

1677


What is static and auto variables in c?

571


What is dynamic variable in c?

569