Notification texts go here Contact Us Buy Now!

22 | Float Notation

Float Notation

In C programming, we can use the letters f or F at the end of a floating-point number to signify that it's a float. For example,

#include <stdio.h>
 
int main() {
 
    // use float notation
    float number = 36.43f;
 
    // print the variable
    printf("%f", number);
  
    return 0;
}
 
// Output: 36.430000

Notice that we've used 36.43f instead of just 36.43. This indicates that the number is of float type.

Alternatively, we can also use F to indicate that it's a float:

float number = 36.43F;
Idea Emoji  Note: It's not compulsory to use f or F to indicate a float value. However, it's a good practice and we recommend it. But we won't be using this notation frequently in this course for the sake of simplicity..

About the Author

Coding | Riding | Music, Embracing the beauty of code, the thrill of the ride, and the rhythm of life. Let's explore the journey together!

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.
Code Copied!