Write a program of precision() function


 

/* Write a program of  precision() function*/

#include<iostream.h>

#include<conio.h>

#include<string.h>

void main()

{

clrscr();

cout<<“34”;

float a=3.46667;

cout.precision(2);

cout<<a;

getch();

}

/* output:    343.47*/

Related Posts

Comments are closed.