Home C Programming Language / Programs / Storage size and range of floating point datatype
🚀 Programming Example

Storage size and range of floating point datatype

👁 1,201 Views
💻 Practical Program
📘 Step Learning
In this program we will find out the size of float data type using sizeof operator. Also we will find out the range of floating point datatype.
No previous program
No next program

💻 Program Code

#include"stdio.h"
#include"float.h"

int main() {

   printf("Storage size for float : %d \n", sizeof(float));
   printf("Minimum float positive value: %E\n", FLT_MIN );
   printf("Maximum float positive value: %E\n", FLT_MAX );
   printf("Precision value: %d\n", FLT_DIG );
   
   return 0;
}
                        

🖥 Program Output

Storage size for float : 4
Minimum float positive value: 1.175494E-038
Maximum float positive value: 3.402823E+038
Precision value: 6
Press any key to continue . . .
                            
No previous program
No next program
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.