Solved: Write a program that asks the user to enter a number that’s positive and multiple of 4

$30.00

Category:

Description

Solved: Write a program that asks the user to enter a number that’s positive and multiple of 4

Write a program that asks the user to enter a number that’s positive and multiple of 4. The user has 3 attempts to find such a number.

Part a) Write the program using for-loop and break a ‘break’ statement

Part b) Write the program using a while-loop and using an invert operator ‘!’ on the whole condition. The while-loop should look like

While (! ( Condition1 And/Or Condtion2) )

Part c) Write the program, using a while-loop without having a global invert operator  ‘!’. You may still use the invert operator for every individual condition. The while-loop should look like:

While (! ( Condition1 And/Or Condtion2) )


error: Content is protected !!