Code:
void surfacearea()
{
redraw:
pcra=0;
pcrb=0;
pcrc=0;
pcrs=0;
pcrarea=0;
pcrr=0;
pcrh=0;
pcrR=0;
pcrr=0;
pcrv=0;
clrscr();
printf("\n\n\t\t ********************************************");
printf("\n\t\t | The surface area of an enclosed cylinder |\n");
printf("\t\t ********************************************");
printf("\n\n\t\t Please enter the Radius (an integer number): ");
if ( scanf( "%d", &pcrr ) != 1 )
{
}
//while ( getchar() != '\n' );
//{
// scanf("%d",&pcrr);
printf("\n\t\t Please enter the Height (an integer number): ");
scanf("%d",&pcrh);
printf("*%d*",pcrr);
hold();
/*if (pcrr <= 0 || pcrh <= 0)
{
printf("\n\n\t\t...You have entered an incorrect value...");
hold();
goto redraw;
}*/
pcrarea = 2 * pcrpi * pcrr * (pcrr + pcrh);
printf("\n\t\t The answer is: %0.2f",pcrarea);
hold();
//}
}
i have tried it a few diff ways round, but it keeps waiting for key presses,
Code Tags added by Kermi3