Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7774873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:29:17+00:00 2026-06-01T17:29:17+00:00

Yesterday I was able to make a program (ASCII converter etc etc) that had

  • 0

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.

 #include <stdio.h>
    /* 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",&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<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>9)
            {
                a=0;
                diff++;
            }
            if(b>9)
            {
                b=0;
            }
            if(diff>9)
            {
                diff=0;
            }
            printf("%d + %d = ",number[a],number[b]);
            scanf("%d",&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",&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>9)
            {
                a=0;
                diff++;
            }
            if(b>9)
            {
                b=0;
            }
            if(diff>9)
            {
                diff=0;
            }
            if(numbers[a]-numbers[b]<0)
            {
                a++;
                subtraction();
            }
            printf("%d - %d = ",numbers[a],numbers[b]);
            scanf("%d",&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",&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>9)
            {
                a=0;
                diff++;
            }
            if(b>9)
            {
                b=0;
            }
            if(diff>9)
            {
                diff=0;
            }
            printf("%d * %d = ",number[a],number[b]);
            scanf("%d",&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",&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]<numbers[b])||numbers[b]==0)
            {
                a++;
                clear();
                divisionquiz();
            }
            if(a>9)
            {
                a=0;
                diff++;
            }
            if(b>9)
            {
                b=0;
            }
            if(diff>9)
            {
                diff=0;
            }
            printf("%d % %d = \n",numbers[a],numbers[b]);
            printf("What is the whole number?\n");
            scanf("%d",&answer);
            printf("What is the remainder? (0 if none\n)");
            scanf("%d",&remain);
            if(answer==numbers[a]/numbers[b] && 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",&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;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:29:18+00:00Added an answer on June 1, 2026 at 5:29 pm

    exit is an external function and you need to include its header at the top of your source code:

    #include <stdlib.h>   // exit
    

    Please notice that in the function call the addition function is called addition and in the function definition additionquiz. Same for the substraction.

    For the other functions, you should declare them before you call them: that is before the main function definition.

    int initialize(void);
    int clear(void);
    int additionquiz(void);
    int subtractionquiz(void);
    int divisionquiz(void);
    int multiplicationquiz(void);
    
    int main(void)
    {
        /* ... */
    

    Note that declaring all the functions in one go like this:

    int initialize(void), clear(void), additionquiz(void),
        subtractionquiz(void), divisionquiz(void), multiplicationquiz(void);
    

    is permitted but it is not very readable and may surprise the reader.

    Finally, if these functions are not called from another source code, you should tell the reader (and the compiler) by adding a static specifier at the beginning of the declaration like this:

    static int clear(void);  // the function is only called in this source code
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed yesterday that I am able to play HTML5 audio on my iPhone
I noticed yesterday that I am able to play HTML5 audio on my iPhone
I installed xcode 4.3.1 yesterday and everything seemed to work fine. I was able
Yesterday I created this piece of code that could calculate z^n, where z is
Is there some way to make boost::python control the Python GIL for every interaction
Yesterday and for about months I was able to push/commit. But since few hours
Yesterday I tried implementing jScrollPane on a resultsSuccess.php template and wasn't able to get
I'd love to be able to parse relative strings like now and yesterday and
Since yesterday I haven't been able to generate strong name keys using sn.exe or
During an ordeal yesterday, I learned that you can't pass this query to EXEC():

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.