Monday, 4 February 2013

switch - 2

Points to remember:
1. break statement is used to come out of switch structure.
2. Each of the case value must be unique. The value should be a constant not a variable.
3. character constant should be enclosed by a single quotation.
4. case is a keyword.
5. After case, colon should be used.
6. Default is optional, but it is a good practice to write it.

1. Write a menu driven program to convert temperature from Centigrade to Fahrenheit.                               [ICSE]
c=(5/9)*(f-32)
f=(1.8)c+32