#include <stdio.h> int main ( void ){ int num1 = 0 ; // fist inputed number int num2 = 0 ; //second inputed number int selection = 0 ; // value for menu selection int counter ; // counter integer printf ( "Hello,this is the Timey wimey Device. It will tell you either:

" ); printf ( "1.Lowest Common Multiple

" ); printf ( "2.Greatest Common Divisor

" ); printf ( "Of two numbers you enter in.

" ); printf ( " Or, enter 3 to exit

" ); scanf ( "%d

" , & selection ); if ( selection == 1 ){ printf ( "Lowest Common Multiple it is!

" ); printf ( "What two numbers do you select?

" ); scanf ( "%d

" , & num1 ); printf ( "What is the second number?

" ); scanf ( "%d

" , & num2 ); for ( counter = 1 ; counter % num1 = 0 ; ++ counter ){ if ( counter % num1 = 0 ){ for ( counter = 1 ; counter % num1 = 0 ; ++ counter ){ printf ( "LCM =%d

" , counter ); }}} printf ( "Hello,this is the Timey wimey Device. It will tell you either:

" ); printf ( "1.Lowest Common Multiple

" ); printf ( "2.Greatest Common Divisor

" ); printf ( "Of two numbers you enter in.

" ); printf ( " Or, enter 3 to exit

" ); scanf ( "%d

" , & selection ); } else if ( selection == 2 ){ printf ( "Greatest Common Divisor it is!

" ); printf ( "What two numbers do you select?

" ); scanf ( "%d

" , & num1 ); printf ( "What is the second number?

" ); scanf ( "%d

" , & num2 ); for ( counter = 1 ; num1 % counter = 0 ; ++ counter ){ if ( num1 % counter = 0 ){ for ( counter = 1 ; num1 % counter = 0 ; ++ counter ){ printf ( "GCD=%d

" , counter ); }}} printf ( "Hello,this is the Timey wimey Device. It will tell you either:

" ); printf ( "1.Lowest Common Multiple

" ); printf ( "2.Greatest Common Divisor

" ); printf ( "Of two numbers you enter in.

" ); printf ( " Or, enter 3 to exit

" ); scanf ( "%d

" , & selection ); } else if ( selection == 3 ){ printf ( "My Timey Wimey Device senses you want to turn this off

" ); printf ( "So...Bye!

" ); return 0 ; } else if ( selection >= 4 ){ printf ( "Wrong selection Sir or Madam.

" ); printf ( "Hello,this is the Timey wimey Device. It will tell you either:

" ); printf ( "1.Lowest Common Multiple

" ); printf ( "2.Greatest Common Divisor

" ); printf ( "Of two numbers you enter in.

" ); printf ( " Or, enter 3 to exit

" ); scanf ( "%d

" , & selection ); } else if ( selection <= 0 ){ printf ( "Wrong selection Sir or Madam.

" ); printf ( "Hello,this is the Timey wimey Device. It will tell you either:

" ); printf ( "1.Lowest Common Multiple

" ); printf ( "2.Greatest Common Divisor

" ); printf ( "Of two numbers you enter in.

" ); printf ( " Or, enter 3 to exit

" ); scanf ( "%d

" , & selection ); } return 0 ; }