Weird issue when looping using the Do While in C <p>I'm running into a weird issue when I try and move my Do loop, or add another loop to nest it. I place the DO where you see it below, it loops through fine:</p> <pre><code>{ float numbers[MAX_DATA]; printf("Please Eneter the Amount of Numbers You Would Like to Use\n"); scanf("%d",&amp;amount); if (amount&gt;MAX_DATA) { printf("Your entry was too big"); } else { input(numbers,amount); do { printf("\nStatistical Calculator Menu\n"); printf("\n(1) Mean\n(2) Standard Deviation\n(3) Range\n(4) Restart/Exit\n"); scanf("%d",&amp;input2); if (input2==1) { mean(numbers,amount); } else if (input2==2) { standard(numbers,amount); } else if (input2==3) { range(numbers,amount); } else if(input2==4) { printf("Would You Like to (5)Restart or (6)Quit?"); scanf("%d",&amp;input2); } } while(input2!=4); } getch(); return 0; } </code></pre> <p>But if I place it here or add an additional do loop to nest it, I get a "expect while before getch" error. </p> <pre><code>{ int amount=0; int input2; do { float numbers[MAX_DATA]; printf("Please Eneter the Amount of Numbers You Would Like to Use\n"); scanf("%d",&amp;amount); if (amount&gt;MAX_DATA) { printf("Your entry was too big"); } else { input(numbers,amount); printf("\nStatistical Calculator Menu\n"); printf("\n(1) Mean\n(2) Standard Deviation\n(3) Range\n(4) Restart/Exit\n"); scanf("%d",&amp;input2); if (input2==1) { mean(numbers,amount); } else if (input2==2) { standard(numbers,amount); } else if (input2==3) { range(numbers,amount); } else if(input2==4) { printf("Would You Like to (5)Restart or (6)Quit?"); scanf("%d",&amp;input2); } } while(input2!=4); } getch(); return 0; } </code></pre> <p>Why do I get this error?</p>