Tuesday, May 14, 2013

Calculate Da,Ta,Hra Using If Else

    /* Calculate Da,Ta,Hra Using If Else  */
    /*
    ****If Basic >= 7000 Then Da 50% Hra 30% And Ta 20%****
    ****If Basic >= 5000 And Basic < 7000 Then Da 30% Hra 20% And Ta 20%****
    */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         float basic,da,ta,hra,gross;
         printf("Enter Your Basic Salary ");
         scanf("%f",&basic);
         if(basic>=7000)
         {
             da=basic*.5;
             hra=basic*.3;
             ta=basic*.2;
             gross=basic+da+ta+hra;          
             printf("Gross=%.2f",gross);
         }
        else if(basic>=5000 && basic<7000)
         {
             da=basic*.3;
             hra=basic*.2;
             ta=basic*.2;
             gross=basic+da+ta+hra;          
             printf("Gross=%.2f",gross);
         }
         else
         {
             printf("Please Enter Your Basic Salary Above Or Equal To 5000");
         }
        
         getch();
      }

The Output is :-



Grade Calculation

    /* Grade Calculation */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         int roll,marks1,marks2,marks3,total;
         char grade,name[8];
         printf("Enter Your Name ");
         scanf("%s",&name);
         printf("Enter Your Roll Number ");
         scanf("%d",&roll);
         printf("Enter marks1 ");
         scanf("%d",&marks1);
         printf("Enter marks2 ");
         scanf("%d",&marks2);
         printf("Enter marks3 ");
         scanf("%d",&marks3);
         total=marks1+marks2+marks3;
         printf("Total Marks Is %d",total);
         printf("\n\n\n ");
         if(total>=280)
            {
            grade='a';
            printf("Grade=%c",grade);
            }
         if(total>=250 && total<280)
            {
            grade='b';
            printf("Grade=%c",grade);
            }
         if(total>=180 && total<250)
            {
            grade='c';
            printf("Grade=%c",grade);
            }
         else if(total<180)
            {
            grade='f';
            printf("Grade=%c",grade);
            }
         getch();
      }


The Output is :-




Find The Depertment Using If Else

    /* Find The Depertment Using If Else */
    /*
    ****Salary Grater Then 6000 Then Depertment Is Company****
    ****Salary Between 3000 to 6000 Then Depertment Is Market****
    ****Salary Less Then 3000 Is Sales****
    ****Find The Depertment Using This Upper Criteria****
    */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         int id,basic;
         printf("Enter Your Company Id ");
         scanf("%d",&id);
         printf("Enter Your Basic Salary ");
         scanf("%d",&basic);
         if(basic>=6000)
         {
             printf("Your Depertment Is Company ");
         }
         else if(basic>=3000 && basic<6000)
         {
             printf("Your Depertment Is Market ");
         }
         else
             printf("Your Depertment Is Sales ");
         getch();
      }




The Output is :-





Friday, May 10, 2013

Find The Even And Odd Number

 /* Find The Even And Odd Number */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         int a;
         printf("Enter The Number ");
         scanf("%d",&a);
         if(a%2==0)
             printf("This Is An Even Number ");
         else
             printf("This Is An Odd Number ");
         getch();
      }

The Output is :-

 

Find The Maximum Value Of Four Number

    /* Find The Maximum Value Of Four Number */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         float a,b,c,d;
         printf("Enter The First Number ");
         scanf("%f",&a);
         printf("Enter The Second Number ");
         scanf("%f",&b);
         printf("Enter The Third Number ");
         scanf("%f",&c);
         printf("Enter The Fourth Number ");
         scanf("%f",&d);
         if(a>b && a>c && a>d)
         {
         printf("First Number Is Maximum");
         }
         else if(b>a && b>c && b>d)
         {
         printf("Second Number Is Maximum");
         }
         else if(c>a && c>b && c>d)
         {
         printf("Third Number Is Maximum");
         }
         else if(d>a && d>b && d>c)
         {
         printf("Fourth Number Is Maximum");
         }
         else
         {
         printf("Please Enter Diffrent Value For Four Number ");
         }
         getch();
      }

The Output is :-

Simple Interest Calculation

    /* Simple Interest Calculation */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         float rate_of_money,year,interest,simple_interest;
         printf("Enter The Rate Of Money ");
         scanf("%f",&rate_of_money);
         printf("Enter The Year ");
         scanf("%f",&year);
         printf("Enter %Of Interest ");
         scanf("%f",&interest);
         simple_interest=(rate_of_money*year*interest)/100;
         printf("The Simple Interest Is %.2f",simple_interest);
         getch();
      }

The Output is :-

Find The Square Root Of A Number

/* Find The Square Root Of A Number */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    #include<math.h>
    void main()
      {
         float a,b;
         printf("Enter The Number For Square Root ");
         scanf("%f",&a);
         b=sqrt(a);
         printf("The Square Root Is %.2f",b);
         getch();
      }

The Output is :-