Thursday, August 30, 2018

8. WAP to find whether an employee will receive bonus or not. Given: The employee will get bonus only if he has been working in the company for more than 3 years. The joining year and current year should be provided by user.

#include<stdio.h>
#include<conio.h>
void main()
{
   int jy,cy,noy,bonus;
   printf("Enter the joining year and current year: ");
   scanf("%d%d",&jy,&cy);
   noy=cy-jy;
   if(noy>3)
   {
    bonus=10000;
    printf("\nEmployee will receive a bonus of Rs. %d "
      "as he has been working for %dyears",bonus,noy);
   }
   else
   {
        printf("\nEmployee will not receive any bonus "
      "as he has been working for %dyears",noy);
   }
   getch();

}


OUTPUT:



Please have a look at the below video lesson posted on my YouTube channel:

No comments:

Post a Comment