Using float variables : multiplication
We will write a programm for multiplication of two float numbers
#include<stdio.h>
void main()
{
float m,d,g; //declaring variables
clrscr(); // clearing terminal
printf("\n\t Enter no 1:"); // asking for 1 st number
scanf("%f",&m); // accepting 1st number
printf("\n\t Enter no 2:"); // asking for 2 nd number
scanf("%f",&d); // accepting 2nd number
g = m * d; // calculating
printf("\n\tResultant multiplication is %f",g); // display
getch(); // hold screen until user press any key
}
output :
0 comments:
Post a Comment