
3-22
Computer Programming with C
EXERCISES
I Attempt the following programming exercises
1. Write a program to shift the entered number by
three bits left and display the result.
2. Write a program to shift the entered number by
five bits right and display the result.
3. Write a program to mask the most significant
digit of the entered number. Use AND operator.
4. Write a program to enter two numbers and find the
smallest out of them. Use conditional operator.
5. Write a program to enter a number and carry
out modular division operation by 2, 3 and 4
and display the remainders.
6. Attempt the program (5) with division opera-
tion and find the quotients. ...