Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA Tutorial
  • Data Structures
  • Algorithms
  • Array
  • Strings
  • Linked List
  • Stack
  • Queue
  • Tree
  • Graph
  • Searching
  • Sorting
  • Recursion
  • Dynamic Programming
  • Binary Tree
  • Binary Search Tree
  • Heap
  • Hashing
  • Divide & Conquer
  • Mathematical
  • Geometric
  • Bitwise
  • Greedy
  • Backtracking
  • Branch and Bound
  • Matrix
  • Pattern Searching
  • Randomized
Open In App
Next Article:
C Program to Generate Multiplication Table
Next article icon

C Program to Multiply two Floating Point Numbers

Last Updated : 07 Aug, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

Floating point numbers are a way to represent real numbers with both whole parts and fractional parts. In this article, we will learn how to write a C program to find the product of two floating-point numbers.

The below image shows an example of floating point multiplication in C:

Multiply two Floating point Numbers

C Program To Multiply Two Floating-Point Numbers

The below C program multiplies two floating numbers using the multiplication operator ( * ).

C




// C program to multiply two
// floating point numbers
#include <stdio.h>
  
// Function to multiply floating point
// numbers
float multiply(float a, float b) 
{ 
  return a * b; 
}
  
// Driver code
int main()
{
    float A = 2.12, B = 3.88, product;
  
    // Calling product function
    product = multiply(A, B);
  
    // Displaying result up to 3 decimal places.
    printf("Product of entered numbers is:%.3f", product);
  
    return 0;
}
 
 
Output
Product of entered numbers is:8.226

Complexity Analysis

  • Time Complexity: O(1)
  • Auxiliary Space: O(1)

Refer to the complete article Multiplying Floating Point Numbers for more details.



Next Article
C Program to Generate Multiplication Table

R

RishabhPrabhu
Improve
Article Tags :
  • C Language
  • C Programs
  • DSA
  • School Programming

Similar Reads

  • Sum of two large Floating-point numbers
    Given two very large floating-point numbers in form of large strings str1 and str2, the task is to add the given two numbers. Example: Input: str1 = "584506134.87368350839565308", str2 = "30598657.0330473560587475634983" Output: 615104791.9067308644544006434983 Input: str1 = "38.30", str2 = "37.0983
    14 min read
  • C Program to Add Two Complex Numbers
    Complex numbers are those numbers that can be expressed in the form of "a+ib" where a and b are the real numbers and i is the imaginary part called "iota" The value of i is √-1. In this article, we are going to add two complex numbers using a C program. Example of Add Two Complex NumberInput: a = (
    3 min read
  • C Program to Swap Two Numbers
    Swapping two numbers means exchanging their values. In this article, we will learn how to swap values of two numbers in a C program. The easiest method to swap two numbers is to use a temporary variable. First, we assign the value of first variable to temporary variable, then assign the value of sec
    2 min read
  • C Program to Generate Multiplication Table
    In this article, we are creating a multiplication table in c which is a basic program for printing tables in c. We are printing multiplication tables of the number up to a given range. We will use the concepts of looping and using a 2-D array to print a Multiplication Table. Multiplication TableA mu
    4 min read
  • C Program to Add Two Integers
    Given two integers, the task is to add these integer numbers and return their sum. Examples Input: a = 5, b = 3Output: 8Explanation: The sum of 5 and 3 is 8. Input: a = -2, b = 7Output: 5Explanation: The sum of -2 and 7 is 5. Add Two Numbers in CIn C, we can add two numbers easily using addition ope
    4 min read
  • C Program To Convert Fahrenheit To Celsius
    In this article, we will learn to write a C Program to convert temperature from Fahrenheit to Celsius by applying the conversion formula to calculate the equivalent temperature in Celsius. For example, 82° in Fahrenheit is equal to 27.7° in Celcius. Formula to Convert Fahrenheit to CelsiusT(°C) = (T
    1 min read
  • LCM of Two Numbers in C
    In this article, we will learn how to write a C program to find the LCM of two numbers. LCM (Least Common Multiple) of two numbers is the smallest positive number that can be divided by both numbers without leaving a remainder. For example, the LCM of 15 and 25 is 75. Algorithm to Find LCM in CFind
    3 min read
  • C Program to Convert Decimal to Octal
    Given a decimal number as input, we need to write a program to convert the given decimal number into an equivalent octal number. i.e convert the number with base value 10 to base value 8. The base value of a number system determines the number of digits used to represent a numeric value. For example
    3 min read
  • C Program To Add Two Numbers Represented By Linked Lists- Set 1
    Given two numbers represented by two lists, write a function that returns the sum list. The sum list is a list representation of the addition of two input numbers. Example: Input: List1: 5->6->3 // represents number 563 List2: 8->4->2 // represents number 842 Output: Resultant list: 1-
    4 min read
  • C Program For Octal to Decimal Conversion
    The number system is one of the ways to represent numbers. Every number system has its own base or radix. For example, Binary, Octal, Decimal, and Hexadecimal Number systems are some of the number systems and are also used in microprocessor programming. These numbers are easy to convert from one sys
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences