Hi I am a beginner and have an assignment due. I feel really stupid about saying this but i studied and did the code in c++ not c.
While trying to redo everything in c i have an error on a do while loop and i don't understand i've corrected everything else but i don't understand why the error occurs even though it says how to fix it
it says error expected ) before token -line 18
part of code
Code:
int main(){
Beep (523,1000); // sound at 523 hertz for 1 000 milliseconds
char cPresent;
do
{
printf("\nPresent recieved: ");
printf("Do you wish to open file (y[es] or n[o])?\n\n"); //prompt
scanf ("%c"; &cPresent);
printf("\n\n");
if (cPresent=='y' || cPresent=='Y')
{
printf("..(\ (\.\n"
".(='.').\n"
".((^)(^).\n"); //bunny
printf("I apologize in advance for my dry sense of humour\n\n");
system("pause");
}
else if (cPresent=='n' || cPresent=='N')
{
printf( "[ERROR] THIS IS NOT A [BRIBE]\n\n");
}
else if (cPresent!='n' ||cPresent!='y'|| cPresent<=0 ||cPresent>=0)
{
printf("[ERROR] Please enter y for yes and n for no\n\n");
}
} while (cPresent=='n'||cPresent=='N');
}
any help would be appreciated- this is just extra bits i've added on to the assignment but I've worked on the c++ code for a week now i have less than a day to redo it