Here is the another Program that how to work with C++ Language. This is the Program where you have given Radius and you have to find out the Area. You can declare PI as a constant value during declaration of variables or you can use directly the value of PI i.e 3.14 in formula.
#include<iostream.h>
#include<conio.h>
void main()
{
float r,a,PI=3.14;
cout<<"enter the radius";
cin>>r;
a=PI*r*r;
cout<<"\n the area is =";
cout<<a;
getch();
}
OUTPUT WILL BE:
#include<iostream.h>
#include<conio.h>
void main()
{
float r,a,PI=3.14;
cout<<"enter the radius";
cin>>r;
a=PI*r*r;
cout<<"\n the area is =";
cout<<a;
getch();
}
OUTPUT WILL BE:
No comments:
Post a Comment