You are on page 1of 1

WORKSHEET 2: if-else statements

1. Write a program in C, called enterEven1, which takes an integer input from the user. If the
number is odd, the user has to enter another number. The program terminates when an even
number is entered. (Note: You cannot tell the user to enter an even/odd number in the
prompt).

2. Write a program in C, called oddOrEven, which prompts the user to enter an integer. The
program tells the user whether they have entered an even or an odd number.

You might also like