Home » , , » Fundamental Data Type - Float Type Variable

Fundamental Data Type - Float Type Variable

Written By Unknown on Sunday, October 6, 2013 | 8:03 AM

Float Data Type :
Float data type represent floating - point number like a number containing a decimal point or exponent.If we need to work with 20.02 we must put it in a float type variable.

Compiler keep 4 byte memory for a float type variable.The highest value for a float type variable is 3.4*10^38 and the lowest value is 3.4*10^-38

Watch the program Carefully :

1.#include<stdio.h>
2.#include<conio.h>
3.main()
4.{
5.float fl;
6.fl=1.0000000000                         -> 10 "0"
7.printf("The value of fl is %f",fl);
8.getch();
9.}


OUTPUT :

The value of fl is 1.000000            -> 6 "0"



Program Analysis :

-> Here fl is announced as a float type variable.

-> As fl = 1.0000000000,so the value of fl is fixed

-> In printf we saw %f.It stands for showing the float number value on the computer screen as like %d shows int value.

-> In the output we can see six 0 after decimal because float type variable don't keep more than six digit after decimal.



Share this article :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Learn Programming - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger| Distributed by Rocking Templates