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.
---------------------------------------------------------------------------
---------------------------------------------------------------------------
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.
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("\nThe Division of %f
and %f is %f.", a, b, a/b);
|
/*You can exclude
the step below.*/
|
printf("\ni.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.000000/7.000000=3.142857
---------------------------------------------------------------------------
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
Post a Comment
Please do not comment any spam links in the comment box.