Thursday

March 5, 2015

March 5, 2015

Posted by **sonnytsn** on Wednesday, January 23, 2008 at 2:57pm.

/*Circle Are program

Calculates the area of a circle using the formula A=pi * r * r

Sonny Hinh, 1/23/08

#include <iostream.h>

int main()

{

cout << "-Calculate the area of a circle-" << endl;

cout << end;

cout << "Radius = " << 10 << endl;

cout << "Area = " << (3.14*10*10) << endl;

return 0;

}

- C++ Programming -
**Quidditch**, Wednesday, January 23, 2008 at 4:01pmDid you intend for the line:

cout<<end;

to really be:

cout<<endl;

- C++ Programming -
**sonnytsn**, Wednesday, January 23, 2008 at 5:08pmi tried and it didn't work :<

and you email me a uncompiled answer?

sonnytsn1_@_gm_ai_l._co_m

- C++ Programming -
**Quidditch**, Wednesday, January 23, 2008 at 5:44pmI did a quick check using MS VS2005. The following compiles correctly. Changing the line:

cout<<endl;

to:

cout<<end;

gives a compile error

--------------------------------

Below compiles using VS2005

--------------------------------

#include <tchar.h>

#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])

{

cout << "-Calculate the area of a circle-" << endl;

cout << endl;

cout << "Radius = " << 10 << endl;

cout << "Area = " << (3.14*10*10) << endl;

return 0;

}

- C++ Programming -
**Quidditch**, Wednesday, January 23, 2008 at 5:46pmmissed the end

-------------------------

#include <tchar.h>

#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])

{

cout << "-Calculate the area of a circle-" << endl;

cout << endl;

cout << "Radius = " << 10 << endl;

cout << "Area = " << (3.14*10*10) << endl;

return 0;

}

- C++ Programming -
**Quidditch**, Wednesday, January 23, 2008 at 5:48pmI guess the double blank lines caused the posting applet to clip the last two lines. Here they are finally, I hope.

--------------------

return 0;

}

- C++ Programming -
**Quidditch**, Wednesday, January 23, 2008 at 5:50pmNope, for some reason the last lines which are not posting.

Anyway, the last lines are the same as your source.

**Answer this Question**

**Related Questions**

c programming - To see how the four steps of the software development procedure ...

c# programming - To see how the four steps of the software development procedure...

object oriented programming 1 - write a c++ program that calculates the area of ...

8th grade math - circle A has a raduis that is twice the length og the raduis of...

math - A circle has an area of 25 pi cm^2.If a circle is drawn within that ...

Algebra - The area of a circle is given by the formula A+pier^2, where r is the ...

MATH HELP PLEASE - You are given two different circles. The diameter of the ...

Math - Cutting a circle into equal sections of a small central angle to find the...

Math - I have a question my brother asked me but I need a math expert. You have ...

Applied Programming - APPLIED PROGRAMMING (APR520S) ASSIGNMENT 1 Problem Solving...