4.4 Exercises
4.4.1 Variable declaration
See Section 12.0.4 for solutions.
Declare two variables
aandband set them to 5 and 18, respectively. Then usebcto calculate their product.Declare a variable
coursethat contains “Introduction to UNIX” and another variablechapterthat contains “Chapter 4”. Using the defined variables, print to the screen the following message: “Introduction to UNIX: Chapter 4!”Declare a variable
messageand set it to 42. Then declare a variablefileand set it toanswer.txt. Printmessagetofile.Declare an additional variable
truththat should contain the content ofmessage. Then changemessageto hold 43 and use these variables to print “The truth istruthnotmessage”