The current year and the year in which the employee joined the organisation are entered through the keyboard . If the number of years for which the employee has served the organisation is greater than 3 years then the bonus of Rs.2500/- is given to the employee. If the years of service is not greater than 3, then the program should not do anything.

 #include<stdio.h>
void main()
{
//ProgramWithHarsh//
int cy,yoj,noy,bonus=0;


printf("\nEnter the current Year =");
scanf("%d",&cy);


printf("\nEnter year of joining =");
scanf("%d",&yoj);
noy=cy-yoj;


if(noy>3)


{
bonus=2500;
printf("\nBonus=Rs.%d",bonus);
        
}

}


The output will be

Post a Comment (0)
Previous Post Next Post