the programe is not wOrking prOpertly with getchar() only......it is wOrking with gt ch,getche and cin bt nOt with getchar.....:(
here iss the prOg cOde.....
#include<conio.h> //header file incLuded tO include get character getch()
#define pi 3.1415926 //to definE the vaLue of a cOnstAnt pi
using namespace std;
float circum(float); //prOtotypE
char tr; // character tr fOr getting char 'y' if u wAnt tO caLcuLatE othEr chaLLan
cout<<"plz give thE rAdius fOr caLcuLating circumfErenc : ";
cout<<"thE circumfErncE of circL = "<<circum(rad);//functOn caLL
cout<<"u wAnt tO calcuLate circumfErencE agAin(y/n)";
//cin>>tr; //use cin tO prOmpt usEr or getch() or getche()
//tr =getch(); //do not show the character enterd
//tr =getche(); //dispLay the character
tr =getchar(); //enter the char untiL entEr is prEsed nOt wOrking right nOw
while(tr == 'y');
Is working fine for me. The readsome command is the key here; I would look that up. Typically there is a line feed or some other value stored in the char which is tricking the buffer into thinking a character has already been fetched.