TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sovan Prusty
NA
2
480
C code is compiling but not giving the desired output.
Dec 4 2016 7:42 PM
I am a beginner. I am trying to write a simple code to calculate the salary. although it is getting compiled but I am not being able to get the desired output.
#include
int main()
{
float a, b, c, d;
printf("Basic salary = \n");
scanf("%f", &a);
b = (40/100)*a;
c = (20/100)*a;
d = b + c;
printf("Gross Salary = %f\n", a+d);
return 0;
}
If I put Basic salary as = 1000.00
I should get Gross salary as 1600.00
but I am getting gross salary same as the basic salary.
please help!
Reply
Answers (
1
)
command arguments
C# Class and three tier architecture