Exercises

Exercise 3-1.

Write a short program creating and initializing each of the following types of variables: int, float, double, char, and then outputting the values to the console.

Exercise 3-2.

Modify the program in Exercise 3-1 to change the values of variables and output the values to the console a second time.

Exercise 3-3.

Modify the program in Exercise 3-2 to declare a constant float Pi equal to 3.14159. Then assign a new value to pi (3.1) and output its value with the other variables. What happens when you try to compile this program?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset