Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

math quiz in c

$
0
0
I have this code but I can't run it. can somebody tell me what is wrong with it?


#include <stdio.h>
 #include <stdlib.h>
 int numbers[10];
 int clear(void);
 int initialize(void);
 int additionquiz(void);
 int subtractionquiz(void);
 int multiplicationquiz(void);
 int divisionquiz(void);

 /* Main Menu */
 int main()
 {
 while(1==1)
 {
 int choice;
 initialize();
 printf("Arithmetic Quiz 4/10/2012");
 printf("\n1 - Addition Quiz\n2 - Subtraction Quiz\n3 - Multiplication Quiz\n4 - Division Quiz\n5 - Exit Program\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(EXIT_SUCCESS);
 }
 else
 {
 printf("\n%cPlease input a valid option\n",7);
 main();
 }
 }
 return 0;
 }
 /* Function for clearing the page */
 int clear()
 {
 int i;
 for(i=0;i<25;i++)
 {
 printf("\n");
 }
 return 0;
 }


Viewing all articles
Browse latest Browse all 51036

Trending Articles