Question: 1. (8 pts) Answer true or false and explain why. a. The following declaration of two integers is valid: int myWeight1, MyWeight1; b. The following

 1. (8 pts) Answer true or false and explain why. a.
The following declaration of two integers is valid: int myWeight1, MyWeight1; b.
The following declaration of a float variable is valid: float 2nd year;
c. The following declaration of a char variable is valid: char re-educated;
d. Not indenting the code properly does not lead to compilation errors.

1. (8 pts) Answer true or false and explain why. a. The following declaration of two integers is valid: int myWeight1, MyWeight1; b. The following declaration of a float variable is valid: float 2nd year; c. The following declaration of a char variable is valid: char re-educated; d. Not indenting the code properly does not lead to compilation errors. 2. (12 pts) What is the output of the following program? #include int main(void) int x - 3, y - 8; x - 2*y; /* 2*y is assigned to variable x */ y - Y + 2, Y + 2 is assigned to y / x - 2x + y 7 the current values of * and are used / printf("x - $d Y - $d ", x, y) : return 0; 3. (15 pts) Fix each printf statement below so the expected output is printed: // Expected output: +75.602% printf("%+.39%", 75.6023); //Expected output: He said "Good Day" printf("She said "Nice Job""); //Expected output: % printf(%c, '%'); 4. (10 pts) Give the output of the following statement. If the program outputs any spaces, tell how many. printf("%+017.4E", 12.52); 5. (10 pts) Write calls to printf to display the variable x in the following formats: a. x is a float. Format: Exponential notation, left justified, in field size of S with 3 digits after the decimal point b. x is an int. Format: Right justified, in a 9 digit field 6. (15 pts) Assume that a and b are int variables and x is a float variable. What is the value of each variable after the following scanf is called? scanf("%d%f%d", &a,&x, &b); supposing the user enters: 9.2 8 13 7. (15 pts) Write a single statement to read the time from the standard Input In the form of h:m:s and store it in three integer variables named hours, minutes and seconds. 8. (15 pts) Write a single statement to read a percentage from the standard input. For example, the user enters 13.6% and program stores 13.6 into a float variable named percent. The variable percent has been declared to be float

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!