Friday, May 17, 2013

Interchange The Value Of 1st And 2nd

/* Interchange The Value Of 1st And 2nd  */

/* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         int a,b,c;
         printf("Enter 1st Value ");
         scanf("%d",&a);
         printf("Enter 2nd Value ");
         scanf("%d",&b);
         c=a;
         a=b;
         b=c;
         printf("The Interchange Value Is : %d %d ",a,b);
         getch();
      }

The Output is :-

Calculate The Area & Perameter Of A Ractangle And The Area & Circumference Of The Circle

/* Calculate The Area & Perimeter Of A Rectangle
   And The Area & Circumference Of The Circle */

/* The Length And Breadth Of A Rectangle And Radius Of A Circle Are Input Through
   The Keyboard. Write A Program To Calculate The Area & Perimeter Of A Rectangle
   And The Circumference Of The Circle */

/* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         float length,breadth,radius,area,perimeter,circumference;
         printf("Enter The Length ");
         scanf("%f",&length);
         printf("Enter The Breadth ");
         scanf("%f",&breadth);
         printf("Enter The Radius ");
         scanf("%f",&radius);
         area=length*breadth;
         printf("Area Of A Rectangle Is = %.2f \n", area);
         perimeter=2*(length+breadth);
         printf("Perimeter Of A Rectangle Is = %.2f \n", perimeter);
         circumference=2*3.14*radius;/* 2 * pi symbol * r = 2*3.14*radius*/
         printf("Circumference Of A Circle Is = %.2f \n", circumference);
         getch();
      }


The Output is :-



Distance Between Two Cities Kilometer To Meters,Feet,Inches,and Centimeters

/* Distance Between Two Cities Kilometer To Meters,Feet,Inches,and
   Centimeters */

/* The Distance Between Two Cities In KM is Input Through The Keyboard. Write A
   Programe To Convert And Print This Distance In Meters,Feet,Inches,and
   Centimeters */

/* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         int km;
         float meters,foot,inch,centimeters;
         printf("Enter The Kilometer ");
         scanf("%d",&km);
         meters=km*1000;
         printf("%d Kilometer = %.2f Meter \n",km,meters);
         foot=km*3280.84;
         printf("%d Kilometer = %.2f Feet \n",km,foot);
         inch=km*39370.1;
         printf("%d Kilometer = %.2f Inch \n",km,inch);
         centimeters=km*100000;
         printf("%d Kilometer = %.2f Centimeter \n",km,centimeters);
         getch();
      }


The Output is :-


Tuesday, May 14, 2013

Find Out The Leap Year

    /* Find Out The Leap Year */

    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         int y;
         printf("Enter The Year ");
         scanf("%d",&y);
         if(y%400 ==0 || (y%100 != 0 && y%4 == 0))
             printf("%d Is A Leap Year ",y);
         else
             printf("%d Is Not A Leap Year ",y); 
         getch();
      }


The Output is :-

Find Entered Charecter Is Capital, Small, Special Charecter Or Digit

    /* Find Entered Charecter Is Capital, Small, Special Charecter Or Digit */

    /*    ASCII Value    */
    /*    A To Z=65 To 90  (Capital Letter)    */
    /*    a To z=97 To 122 (Small Letter)    */
    /*    0 To 9=48 To 57  (Digit)    */
    /*    <48  (Special Charecter)    */

    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         char a;
         printf("Enter Any Charecter ");
         scanf("%c",&a);
         if(a>=65 && a<=90)
         printf("You Have Entered A Capital Charecter");
         if(a>=97 && a<=122)
         printf("You Have Entered A Small Charecter");
         if(a>=48 && a<=57)
         printf("You Have Entered A Digit");
         else if(a<48)  
         printf("You Have Entered A Special Charecter");     
         getch();
      }

The Output is :-


Convert Capital Letter To Small Letter

    /* Convert Capital Letter To Small Letter  */

    /*    ASCII Value    */
    /*    A To Z=65 To 90  (Capital Letter)    */
    /*    a To z=97 To 122 (Small Letter)    */
    /*    0 To 9=48 To 57  (Digit)    */
    /*    <48  (Special Charecter)    */

    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         char a;
         char b;
         printf("Enter Any Capital Letter ");
         scanf("%c",&b);
         a=b+32;
         {
             printf("The Converted Small Letter Is %c",a);
         }        
         getch();
      }

The Output is :-

Convert Capital Letter Or Small Letter To ASCII Value

    /* Convert Capital Letter Or Small Letter To ASCII Value  */

    /*    ASCII Value    */
    /*    A To Z=65 To 90  (Capital Letter)    */
    /*    a To z=97 To 122 (Small Letter)    */
    /*    0 To 9=48 To 57  (Digit)    */
    /*    <48  (Special Charecter)    */

    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         int a;
         char b;
         printf("Enter Any Capital Or Small Letter ");
         scanf("%c",&b);
         printf("The ASCII Value Of This Letter Is %d",b);
         getch();
      }

The Output is :-