-->

Write a program to read annual salary of an employee and decide tax withheld as follows.

//Write a program to read annual salary of an employee and decide tax withheld as follos.
//         salary                                          tax
//            <=100000                                0%
//           upto 150000                              15%
//          above 150000                             25%
#include<stdio.h>
#include<conio.h>
void main()
{
float annual_salary;
float total_tax;
printf("enter total annual salary \n");
scanf("%f",&total_sales);
if(annual_salary<=100000)
    {
         total_tax=0; 
         printf("total tax to be paid=Rs. 0\n");
    }
elseif(annual_salary>100000 &&annual_salary<=150000)
    {
         total_tax=annual_salary*0.15
         printf("total tax to be paid=Rs. %f\n",total_tax);
    }
elseif(annual_salary>150000)
    {
          total_tax=annual_salary*0.25
          printf("total tax to be paid=Rs. %f\n",total_tax);
    } 
printf("thank you!!!!\n");
getch();
}

Write a program to input cost price and selling price and determine whether there is loss or profit.

//Write a program to input cost price and selling price and determine whether there is loss or profit.
#include<stdio.h>
#include<conio.h>
void main()
{
float selling_price,cost_price;
printf("enter cost price \n");
scanf("%f",&cost_price);
printf("enter selling price \n");
scanf("%f",&selling_price);
if(selling_price>cost_price)
    {
          printf("there is profit\n");
          printf(" and profit is=%f\n",selling_price-cost_price);
    }
  else
    {
         printf("there is loss");
         printf(" and loss is=%f\n",cost_price-selling_price);

      }
printf("thank you!!!!\n");
getch();
}

Write a program to read age of person and find out the category among following according to age.

//Write a program to read age of person  and find out the category among following according to age.
//           category                                         age
//            child                                            0 to 12
//            teenage                                         13 to 19
//           adult life                                      20 to 30
//           mature life                                   31 to 50
//          old age                                         over 50

#include<stdio.h>
#include<conio.h>
void main()
{
float age_person;
printf("enter your age \n");
scanf("%f",&age_person);
if(age_person>=0 && age_person<=12)
    {
          printf("Your are child\n");
    }
elseif(age_person>12 && age_person<=19)
    {
          printf("Your are teenage\n");
    }
elseif(age_person>19 && age_person<=30)
    {
          printf("Your are in adult life\n");
    }    
elseif(age_person>30 && age_person<=50)
    {
          printf("Your are passing your mature life now\n");
    }
elseif(age_person>50)
    {
          printf("Your are now an old person\n");
    }
printf("thank you!!!!\n");
getch();
}

A company pays its employee on hourly basis.If an employee works for 8hrs hours he gets 100/hr and 120/hr for additional hours.Write a program to read working hours of an employee and calculate total salary.

//A company pays its employee on hourly basis.If an employee works for 8hrs hours he gets  100/hr
//and 120/hr for additional hours.
//Write a program to read working hours of an employee and calculate total salary.
#include<stdio.h>
#include<conio.h>
void main()
{
float total_working_hrs,extra_hrs;
float total_salary;
printf("enter your total working hours \n");
scanf("%f",&total_working_hrs);
if(total_working_hrs<=8)
    {
           total_salary=total_working_hrs*100
          printf("total salary=Rs. %f\n",total_salary);
    }
elseif(total_working_hrs>8)
    {
         extra_hrs=total_working_hrs-8;
          total_salary=extra_hrs*120+8*100;
         printf("the total salary earned=%f\n",total_salary);
      }

getch();
}


A program to display name of day on the basis of entered number . for example, 2 for Monday.

//Write a program to display name of day on the basis of entered number.
//. for example, 2 for Monday.                        
#include<stdio.h>
#include<conio.h>
void main()
{
int choice;
printf("enter number for day\n");
scanf("%d",&choice);
 switch(choice)
          {
                  case 1:
                            printf("Today is Sunday\n");
                           
                 break;
               case 2:
                            printf("Today is Monday\n");
                           
                 break;

               case 3:
                            printf("Today is Tuesday\n");
                           
                 break;
            case 4:
                            printf("Today is Wednesday\n");
                           
                 break;
            case 5:
                            printf("Today is Thursday\n");
                           
                 break;
           case 6:
                            printf("Today is Friday\n");
                           
                 break;


           case 7:
                            printf("Today is Saturday\n");
                           
                 break;
          default:
                            printf("sorry, not a valid input(beyond 7!!!!\n");
                            printf("thank u, terminating....\n");
          }
getch();
}

note:
here, you can use 'char' data type instead 'int' and you can input data before switch statement as well.
                                           

A company provides commission on the basis of total sales. Find commission.

//A company provides commission on the basis of total sales as follows.
 //        sales<10000-------------------------------->no commission
 //        sales >=10000 and <100000------------->5% commission
 //         sales>100000                  ---------------->10%commission
#include<stdio.h>
#include<conio.h>
void main()
{
float total_sales;
float total_commission;
printf("enter total sales \n");
scanf("%f",&total_sales);
if(total_sales<10000)
    {
          printf("total commission=Rs. 0\n");
    }
elseif(total_sales>=10000 && total_sales<=100000)
    {
         total_commission=total_sales*0.05;
         printf("the amount=%f\n",total_commission);
      }
elseif(total_sales>100000)
    {
        total_commission=total_sales*0.1;
         printf("the amount=%f\n",total_commission);
      }    
printf("thank you!!!!\n");
getch();
}

A program to get greatest value among three numbers using nested if.

//Write a program to get greatest value among three numbers using nested if.
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int x,y,z;
printf("enter  numbers\n");
scanf("%d%d%d",&x,&y,&z);
if(x>y)
{
            if(x>z)
            {
       printf("x is greatest");
            }
           else
          {
             printf("z is greatest\n");
          }
}
else

{
    if(y>x)
     {
     if(y>z)
        {
                printf("y is greatest");
         }
       else
      {
      printf(" z is greatest");
      }
   }
   else
   {
   printf("x is greatest");
   }
}
getch();
}