Section 3.11. Exercises


3.11. 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?



Learning C# 2005
Learning C# 2005: Get Started with C# 2.0 and .NET Programming (2nd Edition)
ISBN: 0596102097
EAN: 2147483647
Year: 2004
Pages: 250

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net