thE cOde is wOrking weLL the prObLem is with that getchar() user input it is nOt taking input frOm the usEr.......the cOde is weLL working with cin,getch() && getche() 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

float rad;
char tr; // character tr fOr getting char 'y' if u wAnt tO caLcuLatE othEr chaLLan

system("cls"); //cLears the scrEEn.....:D
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');


float circum(float rad) //functiOn definAtOn


Please use code tags, and what's with the random capitals ? That makes it hard to read, and makes you look like a troll.
Topic archived. No new replies allowed.