Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
#define PI 3.14159
4.
int main ()
5.
{
6.
float r = 2;
7.
float circle;
8.
circle = 2 * PI * r;
9.
cout
Options:
A .  12.5664
B .  13.5664
C .  10
D .  compile time error
Answer: Option A

In this program, we are finding the area of the circle by using concern formula.
Output:
$ g++ cons.cpp
$ a.out
12.5664



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers