c icon indicating copy to clipboard operation
c copied to clipboard

Learning c language

Open junicoder opened this issue 3 years ago • 2 comments

.

junicoder avatar Oct 07 '22 12:10 junicoder

I have made a PR please review it and give your feedback.

manishyadav12 avatar Oct 20 '22 06:10 manishyadav12

I have to write a program to print two Salaries one as the basic and the other with bonus according to the days if he had worked for days above 25 he'll get bonus other wise he'll not and the one who get bonus will get 1000 per day for each day starting from 25 to the day till 31 like if he came 26 days he'll get 1000 bonus and if 27 he'll get 2000 and so on till 31

The user will input the basic salary and the days which he worked

#include<stdio.h> int main() { int salary , bonus , days, extra=0; printf("Enter the Salary of the employee:\n"); scanf("%d",&salary); printf("Enter the days employee worked:\n"); scanf("%d",&days); while(days>32){ printf("Invalid Input! Please Enter a valid Input.\nEnter the days employee worked:"); scanf("%d",&days); } if(days>25){ extra=days -25; bonus=(extra*1000)+salary; printf("Basic Salary:%d\nSalary(with bonus):%d",salary,bonus); }else{ printf("Basic Salary:%d",salary); } }

whoisyashu avatar Dec 01 '23 02:12 whoisyashu