C++ Program To Multiply Two Floating-Point Numbers Last Updated : 03 Aug, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report Here, we will see how to multiply two floating-point numbers using the C++ program. Floating point numbers are numbers that include both integer part and fractional parts represented in the form of decimal and exponential values. float data type is used to store floating point values. For example Input : A =1.2, B = 3.0 Output : 3.6 We can multiply two floating-point numbers in C++ by using Multiplication Operator (*) C++ Program To Multiply Two Floating-Point NumbersThe two floating-point numbers are multiplied using the function that uses the arithmetic operator ( * ), and the product is stored in the variable product. C++ // C++ program to multiply two // floating point numbers #include <iostream> using namespace std; // Creating a user-defined function // called mul_floatnumbers that // multiplies the numbers passed to // it as an input. It gives you the // product of these numbers. float mul_floatnumbers(float a, float b) { return a * b; } // Driver code int main() { float A = 1.2, B = 3.0, product; // Calling mul_floatnumbers function product = mul_floatnumbers(A, B); // Printing the output cout << product; return 0; } Output3.6Complexity AnalysisTime Complexity: O(1)Auxiliary Space: O(1) Refer to the complete article Multiplying Floating Point Numbers for more details. Comment More infoAdvertise with us Next Article C++ Program To Multiply Two Floating-Point Numbers L laxmigangarajula03 Follow Improve Article Tags : C++ Programs C++ C Basic Programs Practice Tags : CPP Similar Reads C++ Program To Multiply Two Numbers Represented By Linked Lists Given two numbers represented by linked lists, write a function that returns the multiplication of these two linked lists. Examples: Input: 9->4->6 8->4 Output: 79464 Input: 3->2->1 1->2 Output: 3852Recommended: Please solve it on "PRACTICE" first, before moving on to the solution. 3 min read C++ Program To Find Power Without Using Multiplication(*) And Division(/) Operators Method 1 (Using Nested Loops):We can calculate power by using repeated addition. For example to calculate 5^6. 1) First 5 times add 5, we get 25. (5^2) 2) Then 5 times add 25, we get 125. (5^3) 3) Then 5 times add 125, we get 625 (5^4) 4) Then 5 times add 625, we get 3125 (5^5) 5) Then 5 times add 3 3 min read C++ Program For String to Double Conversion There are situations, where we need to convert textual data into numerical values for various calculations. In this article, we will learn how to convert strings to double in C++. Methods to Convert String to Double We can convert String to Double in C++ using the following methods: Using stod() Fun 3 min read C++ Program For Double to String Conversion Here, we will build a C++ program for double to string conversion using various methods i.e. Using to_stringUsing stringstreamUsing sprintfUsing lexical_cast We will keep the same input in all the mentioned approaches and get an output accordingly. Input: n = 456321.7651234 Output: string: 456321.76 2 min read C++ Program to Convert Scientific Notation to Decimal Here, we will see how to convert scientific notations to decimals using a C++ program. Example: 1e9 = 1000000000 1e9 = 1000000000.000000 Calculate power using the pow(a,b) function Header File used: <math.h> pow also referred to as the power of function. Here, pow(a,b) refers to a power b. Let 3 min read Like