Skip to main content

Posts

Showing posts with the label Subtraction of Two Numbers using Three Variables

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;     }...

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(3 Variables)

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