Using float pi=3.14 printing

0

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:

  1. #include<stdio.h>
  2. #include<conio.h>
  3. int main ( )
  4. {
  5. clrscr ( );
  6. const float pi=3.14;
  7. printf ("the value of pi is=%f",pi);
  8. getch( );
  9. }

OUTPUT:

the value of pi is=3.140000

Post a Comment

0Comments
Post a Comment (0)