Program is not compiling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • buntybutt
    New Member
    • Sep 2008
    • 28

    Program is not compiling

    Hi there!
    I just started to learn C++ and wrote a simple program to radius from user and than calculate the Area, Circumference and Diameter, but the problem is it's not executing and I tried my best to get rid of the error, but in vain.
    Please help me to get it executed.
    Here is the program code

    Code:
    #include<iostream.h>
    main()
    {
          float radius;
          float diameter;
          float circumference;
          float area;
          cout<<"Please enter the radius of a circle:";
          cin>>radius;
          diameter=2*radius;
          circumference=2*3.14*radius;
          area=3.14*raidus*radius;
          cout<<"diameter of Circle is:";
          cout<<diameter;
          cout<<"circumference of Circle is:";
          cout<<circumference;
          cout<<"area of Circle is:";
          cout<<area;
    }
    Please tell me where is error in this program.
    Thanks
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Line 1, the standard header file is iostream not iostream.h You would then need a statement using namespace std; to use all the symbols it contains.

    Line 2, main returns int not nothing

    Line 13, you have misspelt radius as raidus

    Line 14 - 19 you do not output any newlines or spaces so the output comes out on 1 line in a very unreadable format.

    Comment

    Working...