- Ledi 3 11 Exercises 3 11 1 Declaring And Printing Variables Given The Table Below Declare The Following Variables With 1 (40.41 KiB) Viewed 37 times
LEDI 3.11 Exercises 3.11.1 Declaring and printing variables Given the table below, declare the following variables with
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
LEDI 3.11 Exercises 3.11.1 Declaring and printing variables Given the table below, declare the following variables with
LEDI 3.11 Exercises 3.11.1 Declaring and printing variables Given the table below, declare the following variables with the corresponding data types and initialization values. Output to the screen the variable names together with the values. Variable name Data Type number Integer letter character result boolean str String The following should be the expected screen output, Number 10 letter a result true str hello 3.11.2 Getting the average of three numbers Create a program that outputs the average of three numbers. Let the values of the three numbers be, 10, 20 and 45. The expected screen output is, number 1 number 2 number 3 Average is 25 10 20 45 Initial value 10 a number 1- 10 number 2 23 number 35 The highest number is 23 true hello 3.11.3 Output greatest value Given three numbers, write a program that outputs the number with the greatest value among the three. Use the conditional 7: operator that we have studied so far (HINT: You will need to use two sets of 7: to solve this). For example, given the numbers 10, 23 and 5, your program should output, Introduction to Programming I 3.11.4 Operator precedence Given the following expressions, re-write them by writing some parenthesis based on the sequence on how they will be evaluated. 1. a/b^c^d-e+f-g+h+1 2.3 10 2/15-2+4^2^2 3. r^s*t/u-v+w^x-y++