Question: ECPioi COMPUTER AND PROGRAM DESIGN 0 OCTOBER 2016 Question1 (a) What is the output of the following program? #include int main () int i- 555;

 ECPioi COMPUTER AND PROGRAM DESIGN 0 OCTOBER 2016 Question1 (a) What

ECPioi COMPUTER AND PROGRAM DESIGN 0 OCTOBER 2016 Question1 (a) What is the output of the following program? #include int main () int i- 555; float f= 456.12378 char s"Bon Voyage"; printf("%.50 n", i); printi(%.3An 963en 96.3gm", f, f, f); printf("%. 7s n",s); return 0; I5 marks] b Write an appropriate C program segment that determines and prints if nl is a 5 marks] (c) Multiplication of two numbers can be performed equivalently by repetitive addition multiple of n2. Both numbers contain integer values. operations. For example, 5 x 3- 5+5+5 (adding 5 repeatedly for 3 times-5 The algorithm shown in Figure Q1.1 (a) inputs two integer values from user, and displays the result of multiplication of the two values. Note that nml, num2 and result are declared to store the two values and the result of the calculation, respectively; and k2 is a counter. Figure Q1.1(b) shows a sample program output (texts in bold are user inputs). prompt user for numl and num2 input numl and num2 Enter two integers: 5 315 set result to 0 set k2 to1 while k2 is less than or equal to num2 add numl to result increment k2 by 1 t multi on result Figure Q1.1(a Figure Q1,1(h

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!