Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 the correct declaration of main?

1154


Explain the process of converting a Tree into a Binary Tree.

2608


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1019


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

1011


What is the purpose of & in scanf?

1009


How does placing some code lines between the comment symbol help in debugging the code?

941


what will be the output for the following main() { printf("hi" "hello"); }

10799


Is there a way to switch on strings?

1027


What are the advantages and disadvantages of a heap?

1147


Is a house a mass structure?

1052


i got 75% in all semester am i eligible for your company

2172


Differentiate abs() function from fabs() function.

962


what is a function method?give example?

2310


Are there any problems with performing mathematical operations on different variable types?

992


How to write a code for reverse of string without using string functions?

2075