// july3ex1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main(int argc, char* argv[])
{   int maxvalue, kount;

/*This program examines all of the numbers 1 through N and prints one
of the following messages next to the number:

	 *  Divisible by 2
	 *  Divisible by 3
	 *  Divisible by both 2 and 3
	 *  Not divisible by 2 nor 3
	 
	*/
	
   printf("Type in the max value: ");
   scanf ("%d", &maxvalue); 	
   printf ("Your max value is %d\n", maxvalue);

   kount = 1;
   while (kount <= maxvalue) {

	   printf("%d ", kount);

	   if (kount % 2 ==0)
           if (kount % 3 == 0)
			   printf ("is divisible by both 2 and 3! \n");
		    else
				printf (" is divisible by 2 only. \n");


		   else /* not kount div by 2 */
            if (kount % 3 == 0)
			   printf ("is divisible by 3 only. \n");
			else
				printf ("is not divisible by 2 or 3. \n");

	   kount = kount +1;


   } /*end of while kount */

	return 0;
}