float : we used float in our program for using a point values like 0.2,0.5 and it format string is ( %f ) and this format string is used in printf and scanf function like .... Printf ("format string", variables); scanf("format string", variable);
Now we make a simple program using float and here is the codes:
INPUT:
- #include<stdio.h>
- #include<conio.h>
- int main ( )
- {
- clrscr ( );
- const float pi=3.14;
- printf ("the value of pi is=%f",pi);
- getch( );
- }
OUTPUT:
the value of pi is=3.140000