Skip to main content

C Program for Multiplication of Two Numbers(2 Variables)

In this easy coded program, you will learn how the multiplication of two numbers takes place using two variables.

Actually, using less variables is preferred the most wherever possible. Rather, the same program can also be solved using three variables.

C Program for Multiplication of Two Numbers(2 Variables)

---------------------------------------------------------------------------

Program for Multiplication of Two Numbers


/*Multiplication of Two Numbers using Two Variables*/

#include<stdio.h>

void main()
{
    int a, b;

    printf("Enter Two Numbers: ");
    scanf("%d %d", &a, &b);

    printf("\nThe Multiplication of %d and %d is %d.", a, b, a*b);
    /*You can exclude the step below.*/
    printf("\ni.e. %dX%d=%d", a, b, a*b);
}
 

Output

Enter Two Numbers: 5 7

The Multiplication of 5 and 7 is 35.
i.e. 5X7=35

---------------------------------------------------------------------------

Hope you found this 'C Program for Multiplication of Two Numbers(2 Variables)' easy, simple and helpful!


Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.

Comments

More Programs

C Program to Print Even Numbers from 1 to 20- while Loop

In this easy coded program, you will learn how to print even numbers from 1 to 20 using while loop. You will not need to take any input from the user as we are defining the end point. --------------------------------------------------------------------------- Program to Print Even Numbers from 1 to 20 /*Even Numbers from 1 to 20- while Loop*/ #include<stdio.h> void main () {     int i =2 ;     while (i <=20 )     {                 printf( "%d \t " , i);                 i +=2 ;     } }   Output 2 4 6 8 10 12 14 16 18 20 --------------------------------------------------------------------------- Hope you found this ' C Program to Print Even Numbers from 1 to 20- while Loop ' easy, simple and helpful! Try to solve more queries by yourself by referring more examples from B

C Program to Print Numbers from a to b using while Loop

In this easy coded program, you will learn how to print numbers from a to b using while loop, where the values of both will be taken from the user. --------------------------------------------------------------------------- Program to Print Numbers from a to b using while Loop /*Print Numbers from a to b- while Loop*/ #include<stdio.h> void main () {     int a, b;     printf( "Enter First Number: " );     scanf( "%d" , & a);     printf( " \n Enter Last Number: " );     scanf( "%d" , & b);     while (a <= b)     {         printf( "%d \t " , a);         ++ a;     } }   Output Enter First Number : 3 Enter Last Number : 9 3 4 5 6 7 8 9

C Program to Print Even Numbers from 1 to n using for Loop

In this easy coded program, you will learn how to print even numbers from 1 to 'n' using for loop. Here, 'n' is the number up to which the user wants the even numbers to be printed. --------------------------------------------------------------------------- Program to Print Even Numbers from 1 to n using for Loop /*Even Numbers from 1 to n- for Loop*/ #include<stdio.h> void main () {     int i, num;     printf( "Enter Number: " );     scanf( "%d" , & num);     for (i =2 ; i <= num; i +=2 )         printf( "%d \t " , i); }   Output Enter Number : 8 2 4 6 8 --------------------------------------------------------------------------- Hope you found this ' C Program to Print Even Numbers from 1 to n using for Loop ' easy, simple and helpful! Try to so

C Program to Calculate Simple Interest

In this easy coded program, you will learn how to calculate simple interest by taking input of principle amount, number of years and rate of interest from user. Try adding final calculated amount which will include the principle amount plus the calculated simple interest in this program for your self practice. --------------------------------------------------------------------------- Program to Calculate Simple Interest /*Simple Interest*/ #include<stdio.h> void main () {         float p, n, r, si;         printf( "Enter Principle Amount, No. of Years, Rate of Interest= " );         scanf( "%f %f %f" , & p, & n, & r);         si = (p * n * r) /100 ;         printf( " \n Simple Interest= %f" , si); }   Output   Enter Principle Amount, No. of Years, Rate of Interest = 1000 10 10 Simple

C Program to Print Even Numbers from 1 to 20 using for Loop

In this easy coded program, you will learn how to print even numbers from 1 to 20 using for loop. --------------------------------------------------------------------------- Program to Print Even Numbers from 1 to 20 using for Loop /*Even Numbers from 1 to 20- for Loop*/ #include<stdio.h> void main () {     int i;     for (i =2 ; i <=20 ; i +=2 )         printf( "%d \t " , i); }   Output 2 4 6 8 10 12 14 16 18 20 --------------------------------------------------------------------------- Hope you found this ' C Program to Print Even Numbers from 1 to 20 using for Loop ' easy, simple and helpful! Try to solve more queries by yourself by referring more examples from BEGINC . Here you will get the most easiest code to each and every query. Keep practi

C Program for Addition of Two Numbers(2 Variables)

In this easy coded program, you will learn how the addition of two numbers takes place using two variables. Actually, using less variables is preferred the most wherever possible. Rather, the same program can also be solved using three variables. --------------------------------------------------------------------------- Program for Addition of Two Numbers /*Addition of Two Numbers using Two Variables*/ #include<stdio.h> void main () {     int a, b;     printf( "Enter Two Numbers: " );     scanf( "%d %d" , & a, & b);     printf( " \n The Addition of %d and %d is %d." , a, b, a + b);     /*You can exclude the step below.*/     printf( " \n i.e. %d+%d=%d" , a, b, a + b); }   Output Enter Two Numbers : 5 7 The Addition of 5 and 7 is 12. i.e. 5+7=12 --------------------

C Program to Print Table till 'n'

In this easy coded program, you will learn how to print table till 'n'. You will have to take input of the number which will tell the compiler up to where it has to print the table(s). --------------------------------------------------------------------------- Program to Print Table till 'n' /*Table till n*/ #include<stdio.h> void main () {     int num, i, j, a;     j =1 ;     printf( "Enter Number: " );     scanf( "%d" , & num);     while (j <= num)     {             for (i =1 ; i <=10 ; i ++ )         {             a = j * i;             printf( " \n %d X %d = %d" , j, i, a);         }     printf( " \n " );     j ++ ;     } }   Output  

C Program for Division of Two Numbers(2 Variables)

In this easy coded program, you will learn how the division of two numbers takes place using two variables. Actually, using less variables is preferred the most wherever possible. Rather, the same program can also be solved using three variables. --------------------------------------------------------------------------- Program for Division of Two Numbers /*Division of Two Numbers using Two Variables*/ #include<stdio.h> void main () {     float a, b;     printf( "Enter Two Numbers: " );     scanf( "%f %f" , & a, & b);     printf( " \n The Division of %f and %f is %f." , a, b, a / b);     /*You can exclude the step below.*/     printf( " \n i.e. %f/%f=%f" , a, b, a / b); }   Output Enter Two Numbers : 22 7 The Division of 22.000000 and 7.000000 is 3.142857 . i.e. 22.000

C Program to Print Even Numbers from 1 to 'n'- while Loop

In this easy coded program, you will learn how to print even numbers from 1 to 'n' using while loop. Here, 'n',i.e. the end point will be given by the user and hence we will need to take input of the same. --------------------------------------------------------------------------- Program to Print Even Numbers from 1 to 'n' /*Even Numbers from 1 to n- while Loop*/ #include<stdio.h> void main () {     int i =2 , num;     printf( "Enter Number: " );     scanf( "%d" , & num);     while (i <= num)     {                 printf( "%d \t " , i);                 i +=2 ;     } }   Output Enter Number : 11 2 4 6 8 10 --------------------------------------------------------------------------- Hope you found this ' C Program to Print Eve