17-Write a C program to calculate the salary with bonus.

Program: 17

Write a C program to calculate the salary with bonus.

#include
#include
void main()
{
    int sal= 10000, bonus, cy, yoj, yos;
    printf("Enter the current year: ");
    scanf("%d", &cy);
    printf("Enter the year of joining: ");
    scanf("%d", &yoj);
    yos=cy-yoj;
    if(yos>3)
    {
        bonus=2500;
        printf("Salary + Bonus = %d", sal+bonus);
    }
    else
        printf("Salary = %d", sal);
getch();
}
Output
Enter the current year: 2017

Enter the year of joining: 2011

Salary + Bonus = 12500

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.