Some questions on conditional statements
- What is wrong with each of the following statements?
- if x==4 y++;
- if(x=4) ++y;
- if (x==4) ++y else --y;
- Write a program which reads in two integer numbers and writes out the larger
of the two.
You may want to refer ahead to find out how to read
innumbers or write them out.
Answers to these questions.
Back to the notes on conditionals.