Question: Please solve all the problems except the first one. thanks 1 mark each. Closed notes and books. X 1. What is the result of the
Please solve all the problems except the first one.
thanks
1 mark each. Closed notes and books. X 1. What is the result of the following in c code? 12/2+2%3 int num=8 6 1 2. Write one C statement that would print "The product is followed by the value of the integer variable result. The cursor should be on a new line after the statement is executed. Y n 3. Write one c code statement that declares the variable num as an integer and initializes it to X 8. 8% 2 + 2/3=444 = +8 Printf("The product is X The following segment of code is supposed to print 5 4 3 2 1 in one column (vertically). Correct the errors. int y = 5 while (y ) 2 printf("%d", y); Y--; } in 5. Write an if-else statement that prints "odd" if the value of the variable number is an odd number, else it prints "even". Assume that variable number has already been declared and a value stored in it. if (number 22:21) printf(" odd"); else printf("even"); 6. What are the three kinds of loop structures? for while, do-while, 7. What is an algorithm? Algorithm is like a block of codes More at the back 2 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
