Quote:
Originally Posted by pgmr_prantik
//define constants: calculate circumference
#include<iostream>
#include<conio>
using namespace std;
#define PI 3.14159
#define NEWLINE '\n'
int main()
{
double r = 5.0; //radius
double circle;
circle = 2*PI*r;
cout << circle;
cout << NEWLINE;
return 0;
getch ();
}
I''m new to programming, In the above code line 20 D:\Dev-Cpp\bin\Tests\circle_circumference1.cpp `getch' undeclared (first use this function)
I do not understand .....what is the error? Plz help me
|
Hi,
its not an issue with the space between getch and (). You should use getch() before return 0;
getch();
return 0;
because return 0 means that your program is returing from here. It will never reach getch();
Regards,
mbatra