1. Write a C statement to do each of the following: Declare 2 variables, sum, and product, of type double. (ii) Repeat (
Posted: Fri May 20, 2022 12:45 pm
statement to do each of the following: Declare 2 variables, sum, and product, of type double. (ii) Repeat (i) and initialize the variables to 0. (iii) Prompt the user to enter an integer. End your prompting message with a colon (:) followed by a space and leave the cursor positioned after the space. How do you leave the cursor positioned at the beginning of the next line? 2. Study the program below and answer the following questions. State the line numbers that instruct the computer to: (i) create variables in memory. (ii) obtain input from the user. (iii) display messages on the computer screen. (iv) execute instructions based on some conditions. (v) store value to an identifier (name of a variable). #include <stdio.h> /* line 1 */ int main(void) { int numberi, number2, smaller; /* line 2 */ printf("Enter the first integer: "); scanf("%d", &numberl); printf ("Enter the second integer: "); scanf("%d", &number2); /* line 3 */ /* line 4 */ /* line 5 */ /* line 6 */ if (number1 > number2) smaller = number2; else smaller = numberl; /* line 7 */ /* line 8 */ /* line 9 */ /* line 10 */ printf("%d is the smaller integer.", smaller); /* line 11 */ return 0;
1. Write a C