What are Floating-Point Numbers - C Data Type

C examples for Data Type:Introduction

Introduction

Floating-point numbers includes signed and unsigned decimal and fractional numbers.

Signed numbers include positive and negative numbers.

Unsigned numbers can only include positive values.

Examples of floating-point numbers are shown in the following list.

09.1234 
3428.12 
112.12345 
-342.66 
-12345.12345 

Use the keyword float to declare floating-point numbers.

The following code declares three floating-point variable data types called operand1, operand2, and result.

Demo Code


#include <stdio.h> 
int main(){ /*w  ww. j  a v a 2s  .com*/
    float operand1; 
    
    float operand2; 
    
    float result; 

    printf("three float numbers declared."); 
}

Result


Related Tutorials