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
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Compare interpreters and compilers.
What is the scope of local variable in c?
Explain how many levels deep can include files be nested?
What is pointers in c?
Describe the difference between = and == symbols in c programming?
Can two or more operators such as and be combined in a single line of program code?
What is a lookup table in c?
What are the types of data types and explain?
Can we declare function inside main?
What is a struct c#?
Are global variables static in c?
How can I get random integers in a certain range?
Is it valid to address one element beyond the end of an array?