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 the correct declaration of main?
Explain the process of converting a Tree into a Binary Tree.
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
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 is the purpose of & in scanf?
How does placing some code lines between the comment symbol help in debugging the code?
what will be the output for the following main() { printf("hi" "hello"); }
Is there a way to switch on strings?
What are the advantages and disadvantages of a heap?
Is a house a mass structure?
i got 75% in all semester am i eligible for your company
Differentiate abs() function from fabs() function.
what is a function method?give example?
Are there any problems with performing mathematical operations on different variable types?
How to write a code for reverse of string without using string functions?