Note that there are some explanatory texts on larger screens.

plurals
  1. POMissing prototype in my practice arithmetic quiz program, and almost every other program I make
    text
    copied!<p>Yesterday I was able to make a program (ASCII converter etc etc) that had the same problem [ Every function had a missing prototype error when I build the program ] I was able to fix it through random trial and error having no idea how I did it. Here's my arithmetic quiz practice program. I also tried putting int initialize(),clear(),exit(),additionquiz(),subtractionquiz(),divisionquiz(),multiplicationquiz(); and it still gave me a missing prototype. </p> <pre><code> #include &lt;stdio.h&gt; /* Main Menu */ int numbers[10]; int main() { while(1==1) { int choice; initialize(); printf("Arithmetic Quiz Program\n"); printf("1 - Addition\n2 - Subtraction\n3 - Multiplication\n4 - Division\n5 - Exit\n"); scanf("%d",&amp;choice); if(choice==1) { clear(); additionquiz(); } else if(choice==2) { clear(); subtractionquiz(); } else if(choice==3) { clear(); multiplicationquiz(); } else if(choice==4) { clear(); divisionquiz(); } else if(choice==5) { exit(); } else { printf("%cPlease choose a number from 1 - 5",7); clear(); continue; } } return 0; } /* For clearing the page */ int clear() { int i; for(i=0;i&lt;25;i++) { printf("\n"); } } /* Assigns the array */ int initialize() { numbers[0]=6; numbers[1]=0; numbers[2]=2; numbers[3]=5; numbers[4]=3; numbers[5]=1; numbers[6]=9; numbers[7]=4; numbers[8]=7; numbers[9]=8; return 0; } /* addition quiz */ int addition() { int a,diff,b,answer,choice; a=0; diff=1; b=a+diff; while(1==1) { if(a&gt;9) { a=0; diff++; } if(b&gt;9) { b=0; } if(diff&gt;9) { diff=0; } printf("%d + %d = ",number[a],number[b]); scanf("%d",&amp;answer); if(answer==number[a]+number[b]) { printf("\nCORRECT!!!\n"); a++; } else { printf("\nWRONG!!!\n"); clear(); additionquiz(); } printf("\nWhat do you want to do next?\n1 - Answer another addition Question\n2 - Go back to main menu\n3 - Exit program\n"); scanf("%d",&amp;choice); if(choice==1) { clear(); additionquiz(); } else if(choice==2) { clear(); main(); } else if(choice==3) { exit(); } else { printf("%cPlease choose a number from 1 to 3",7); } } return 0; } /* The subtraction quiz */ int subtraction() { int a,diff,b,answer,choice; a=0; diff=1; b=a+diff; while(1==1) { if(a&gt;9) { a=0; diff++; } if(b&gt;9) { b=0; } if(diff&gt;9) { diff=0; } if(numbers[a]-numbers[b]&lt;0) { a++; subtraction(); } printf("%d - %d = ",numbers[a],numbers[b]); scanf("%d",&amp;answer); if(answer==numbers[a]-numbers[b]) { printf("CORRECT!!!\n\n"); } else { printf("WRONG!!!\n\n"); clear(); subtractionquiz(); } printf("\nWhat do you want to do next?\n1 - Answer another subtraction Question\n2 - Go back to main menu\n3 - Exit program\n"); scanf("%d",&amp;choice); if(choice==1) { clear(); subtractionquiz(); } else if(choice==2) { clear(); main(); } else if(choice==3) { exit(); } else { printf("%cPlease choose a number from 1 to 3",7); } } return 0; } /* multiplication quiz */ int multiplicationquiz() { int a,diff,b,answer,choice; a=0; diff=1; b=a+diff; while(1==1) { if(a&gt;9) { a=0; diff++; } if(b&gt;9) { b=0; } if(diff&gt;9) { diff=0; } printf("%d * %d = ",number[a],number[b]); scanf("%d",&amp;answer); if(answer==number[a]*number[b]) { printf("\nCORRECT!!!\n"); a++; } else { printf("\nWRONG!!!\n"); clear(); multiplicationquiz(); } printf("\nWhat do you want to do next?\n1 - Answer another multiplication Question\n2 - Go back to main menu\n3 - Exit program\n"); scanf("%d",&amp;choice); if(choice==1) { clear(); multiplicationquiz(); } else if(choice==2) { clear(); main(); } else if(choice==3) { exit(); } else { printf("%cPlease choose a number from 1 to 3",7); } } return 0; } /* Division quiz */ int divisionquiz() { int a,diff,b,answer,choice,remain; a=0; diff=1; b=a+diff; while(1==1) { if((numbers[a]&lt;numbers[b])||numbers[b]==0) { a++; clear(); divisionquiz(); } if(a&gt;9) { a=0; diff++; } if(b&gt;9) { b=0; } if(diff&gt;9) { diff=0; } printf("%d % %d = \n",numbers[a],numbers[b]); printf("What is the whole number?\n"); scanf("%d",&amp;answer); printf("What is the remainder? (0 if none\n)"); scanf("%d",&amp;remain); if(answer==numbers[a]/numbers[b] &amp;&amp; remain==numbers[a]%numbers[b]) { printf("\nCORRECT!!!"); a++; } else { printf("\nWRONG!!!"); clear(); divisionquiz(); } printf("\nWhat do you want to do next?\n1 - Answer another division Question\n2 - Go back to main menu\n3 - Exit program\n"); scanf("%d",&amp;choice); if(choice==1) { clear(); divisionquiz(); } else if(choice==2) { clear(); main(); } else if(choice==3) { exit(); } else { printf("%cPlease choose a number from 1 to 3",7); } } return 0; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload