Welcome To Uday Satya Blog

01 - 05 PROGRAMS


/*********************************************
      1. To Print Welcome To 'C' Language
 *********************************************/

  
   #include<*stdio.h>
   #include<*conio.h>
   void main()
    {
    clrscr();
    printf("\n Welcome to C Language ");
    getch();
    }


  Output :
 
  Welcome to C Language

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/* *******************************************************
                2. To Find Sum of any Two Numbers
    ******************************************************* */

   #include<*stdio.h>
   #include<*conio.h>
   void main()
    {
    int a,b,sum;
    clrscr();
    printf("\n Enter any Two Numbers to be Added : ");
    scanf("%d %d", &a, &b);
    sum = a+b;
    printf("\n\n Sum of These Two Numbers is : %d", sum);
    getch();
    }

   Output :

   Enter any Two Numbers to be Added : 6 8

   Sum of  These Two Numbers is : 14
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


/* *******************************************************
              3. To Find Sum Of Three Numbers
    ******************************************************* */

   #include<*stdio.h>
   #include<*conio.h>
   void main()
    {
     int a,b,c,Sum;
     clrscr();
     printf("\n Enter any Three Numbers,To Add : ");
     scanf ("%d %d %d",&a, &b, &c);
     Sum = a+b+c;
     printf("\n\n Sum of Given Three Numbers is : %d",Sum);
     getch();
    }

     Output :
    
     Enter any Three Numbers,To Add : 3 4 5

     Sum of Given Three Numbers is : 12  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                              
/* *******************************************************
            4. To Find Product of Two Numbers
    ******************************************************* */

   
#include<*stdio.h>
   #include<*conio.h>

   void main()
    {
     int a,b,product;
     clrscr();
     printf("\n Enter any Two Numbers,To Multiply : ");
     scanf ("%d %d",&a, &b);
     product = a*b;
     printf("\n\n Product of Given Two Numbers is : %d", product);
     getch();
    }

    Output :

    Enter any Two Numbers,To Multiply : 3 6

    Product of Given Two Numbers is : 18

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/* *******************************************************
                 5. To Print The Entered Value
    ******************************************************* */

   #include<*stdio.h>
   #include<*conio.h>
   void main()
    {
     int x;
     clrscr();
     printf("\n Enter any Number You Want to Print : ");
     scanf ("%d",&x);
     printf("\n\n The Number You Entered is : %d", x);
     getch();
    }

   Output :

   Enter any Number You Want to Print : 6

   The Number You Entered is : 6  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


                                                                                                                                  

0 comments:

Post a Comment