C Program to Multiply Two Floating Point Numbers

Write a C program to multiply two floating point numbers and print the result. In this C example, we declare two floating point numbers and calculate the product of those two floating point numbers.

#include <stdio.h>

int main()
{

	float first = 11.7f;
	float second = 12.2f;

	float third = first * second;

	printf("\nProduct of two Floating Point Numbers = %.2f\n", third);
}
C Program to Multiply Two Floating Point Numbers

This C program allows entering two floating point numbers and displays the multiplication result.

#include <stdio.h>

int main()
{
	float first, second;
	
	printf("Enter the First Floating Point Number =  ");
	scanf("%f", &first);

	printf("Enter the Second Floating Point Number =  ");
	scanf("%f", &second);

	float third = first * second;

	printf("Product of two Floating Point Numbers = %.2f\n", third);
}
Enter the First Floating Point Number =  23.98
Enter the Second Floating Point Number =  43.67
Product of two Floating Point Numbers = 1047.21


Enter the First Floating Point Number =  12.59
Enter the Second Floating Point Number =  125.987
Product of two Floating Point Numbers = 1586.18

In this C example, the multiplicationofTwo function accepts two floating point numbers and returns the product or multiplication of them.

#include <stdio.h>

float multiplicationofTwo(float a, float b)
{
	return a * b;
}

int main()
{
	float first, second;
	
	printf("Enter the First Floating Point Number =  ");
	scanf("%f", &first);

	printf("Enter the Second Floating Point Number =  ");
	scanf("%f", &second);

	float third = multiplicationofTwo(first, second);

	printf("Product of two Floating Point Numbers = %.2f\n", third);
}
Enter the First Floating Point Number =  22.9
Enter the Second Floating Point Number =  44.56
Product of two Floating Point Numbers = 1020.42