AllAlgorithms / c

Implementation of All ▲lgorithms in C Programming Language
https://github.com/AllAlgorithms/c
MIT License
1.44k stars 520 forks source link

Learning c language #379

Open junicoder opened 1 year ago

junicoder commented 1 year ago

.

manishyadav12 commented 1 year ago

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

whoisyashu commented 7 months ago

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

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); } }