Tuesday, December 30, 2014

C using Eb bill and formula and Employye details pro



EB Bill Program
         
          #include
          #include
          void main()
          {
          char name[20];
          float or,er,cr,u=1.50,amount;
          clrscr();
                   printf("Enter the customer name\n");
                   scanf("%s",name);
                   printf("Enter the end reading and opening reading\n");
                   scanf("%f%f",&er,&or);
                   cr=er-or;
                   amount=cr*u;
                   printf("\n Customer Name       :%s",name);
                   printf("\n Current reading       :%f",cr);
                   printf("EB Amount                 :%f",amount);
          getch();
}

Output
          
          Enter the customer name
          Raja
          Enter the end reading and open reading
          450
          360
          Customer Name   :         Raja
          Current reading    :         90.000000
          Amount                :         135.000000

Formula Program

#include
#include
#include
void main()
{
float a,b,tot;
clrscr();
          printf(" Enter the a,b value\n");
          scanf("%f%f”,&a,&b);
          tot=sqrt((a*a)+(b*b));
          printf("Total = %f",tot);
getch();
}

Output
       
          Enter the a,b value
          10
2
Total : 10.19804

Employee Program

#include
#include
void main()
{
char ename[10],add[10],qua[10];
int age,salary,bonus,it,grossal,netsal;
clrscr();
          printf("Enter the employee name\n");
          scanf("%s",ename);
          printf("Enter your address\n");
          scanf("%s",add);
          printf("Enter your qualification\n");
          scanf("%s",qua);
          printf("Enter your age\n");
          scanf("%d",&age);
          printf("Enter your salary\n");
          scanf("%d",&salary);
          printf("Enter your bonus\n");
          scanf("%d",&bonus);
          printf("Enter your income tax\n");
          scanf("%d",&it);
          grosssal=salary+bonus;
          netsal=grosssal-it;
          printf("\n Name                       :%s",ename);
          printf("\n Address                             :%s",add);
          printf("\n Qualification            :%s",qua);
          printf("\n Age                          :%d",age);
          printf("\n Salary                      :%d",salary);
          printf("\n Grosssalary             :%d",grosssal);
          printf("\n Netsalary                 :%d",netsal);
getch();
}

Output
          
          Enter the employee name
          Ragul
          Enter your address
          Dindigul
          Enter your qualification
          BBA
          Enter your age
          25
          Enter your salary
          6000
          Enter your bonus
          2000
          Enter your income tax
          500
          Name                    : Ragul
          Address                : Dindigul
          Qualification        : BBA
          Age                       : 25
          Salary                            : 6000
          Gross salary                  : 8000
          Net salary             : 7500

No comments:

Post a Comment