/*Kevin Wells*/ /*Assignment 7*/ /*Buzz1803@yahoo.com*/ /*March 7, 2001*/ #include #include "divideseven.h" int main(){ /*initializing variables to use during calculations*/ int numProcess; int count; int noSound; int flag; noSound=0; printf ("Welcome to the Bing Bang and Buzz Program. \n"); /*ask for how many number to process*/ printf ("\nHow many Numbers to process now?"); scanf ("%d", &numProcess); /*use the for loop to check the divisiblity of the integers*/ for (count=1;count<=numProcess; count++){ printf ("\n\t%5d", count); /*The flag will be used to check if numbers produce a sound*/ flag=0; /*this will check if the number 'count' is divisible by 3*/ if (DividesEven(count, 3)){ printf (" Bing"); flag=1; } /*this will check if the number 'count' is divisible by 5*/ if (DividesEven(count, 5)){ printf (" Bang"); flag=1; } /*this will check if the number 'count' is divisible by 7*/ if (DividesEven(count, 7)){ printf (" Buzz"); flag=1; } /*this will check if flag is equal to 1, if not it will add to the 1 to the variable noSound*/ if (flag==0){ noSound+=1; } } /*this prints out the number of numbers with no sound, using the variable noSound as a counter*/ printf ("\n %d numbers have no sound.\n", noSound); return 0; }