Hello,
m begginer to c++, i've a problem in program in codeblocks..my program is simple and i've built it in main.cpp.its about circumference nd volume of the circle:
here is the program:
#include<stdio.h>
#include<conio.h>
#define PI 3.1427
void main()
{
int r;
float cir, vol;
cout<<"Enter the radius of sphere=";
cin>>r;
cir=4*PI*r*r;
vol=4/3*PI*r*r*r;
cout<<"\n circum of the sphere is="<<cir;
cout<<"\n volume of the sphere is="<<vol;
getch();
}
and the errors are:
'cout' was not declare in the scope
'cin' was not declared in the scope
error::'main' must return 'int'
in function 'int main()'
is there like to define objects in main.cpp and doing program in other file under sources.. plz help!!
heartlly thanks and sorry if i've done mistakes in wriiting msg..
m begginer to c++, i've a problem in program in codeblocks..my program is simple and i've built it in main.cpp.its about circumference nd volume of the circle:
here is the program:
#include<stdio.h>
#include<conio.h>
#define PI 3.1427
void main()
{
int r;
float cir, vol;
cout<<"Enter the radius of sphere=";
cin>>r;
cir=4*PI*r*r;
vol=4/3*PI*r*r*r;
cout<<"\n circum of the sphere is="<<cir;
cout<<"\n volume of the sphere is="<<vol;
getch();
}
and the errors are:
'cout' was not declare in the scope
'cin' was not declared in the scope
error::'main' must return 'int'
in function 'int main()'
is there like to define objects in main.cpp and doing program in other file under sources.. plz help!!
heartlly thanks and sorry if i've done mistakes in wriiting msg..