Skip to main content

Posts

Showing posts with the label Multiplication of Two Numbers using Three variables

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 mos...

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. --------------------------------------------------------------------------- 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( " \n The Multiplication of %d and %d is %d." , a, b, a * b);     /*You can exclude the step below.*/     printf( " \n i.e. %dX%d=%d" , a, b, a * b); }   Output Enter Two Numbers...

C Program for Subtraction of Two Numbers(2 Variables)

In this program, you will learn how the subtraction 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 Subtraction of Two Numbers /*Subtraction 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 Subtraction 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 Subtract...