%------------------------------------------------------- % exercise1.tex % Exercise 1. % % Irit Dinur %-------------------------------------------------------- Note: You are to submit printouts of the source codes of the programs along with printouts of a demonstrated running of each program. \footnote{ {\bf Course web-page:} {\tt http://www.math.tau.ac.il/\tildegen{}dinur/C/fall98-9.html} } Identifiers Which of the following are legal identifiers and why: \begin{verbatim} 3id _yes 0_no_o_no 00_go star*it 1_i_am one_i_aren't xYshouldI me_to-2 int \end{verbatim} \exercise{1.2}{Rectangle} Write a program that asks the user for values of three sides of a box (in cm), and outputs the volume (in cubic meters). \exercise{1.3}{Unit conversion} Write a conversion program that asks the user for a value in pounds, and then converts it to kgs. {\it 1 pound = 0.4536 kg }. \exercise{1.3}{ASCII} Write a program that asks the user for a capital letter, and then prints the same later uncapitalized. (hint: the ASCII value of 'a' is equal to the ASCII value of 'A'+32).