Wednesday, 17 July 2013




//// here I set precision of 2 spaces ////// #include "stdafx.h"#include "stdio.h"#include "conio.h"#include "iostream"#include "iomanip"#define Pi 3.14using namespace std;int main(){       float a,r;       cout<<"enter radius of circle";       cin>>r;       a=Pi*r*r;       cout.setf(ios::fixed,ios::floatfield);       cout.precision(2);       cout<<"area="<<a;       getch();}

0 comments :

Post a Comment