What will be the output of the following algorithm? start declare a, i and b for i = 0 to 4 increment a by 1 if i=3 then print hello break the loop end if end for print a14hellohello4Clear ResponseSave & Next
Question
What will be the output of the following algorithm? start declare a, i and b for i = 0 to 4 increment a by 1 if i=3 then print hello break the loop end if end for print a14hellohello4Clear ResponseSave & Next
Solution
The output of the algorithm will be:
hello 3
Similar Questions
What is the output of the following code snippet?int i = 0;do { if (i == 3) continue; System.out.print(i + " "); i++;} while (i < 5);Question 4Answera.0 1 2 3 4b.1 2 3 4c.0 1 2 d.0 1 2 3 4
What will be the output of the following Pseudocode?. int a=10, b=4, i. if (a+b>14). print a. else . for(i=1 to 3 ). a = a+i. end for loop. print a4101614
What will be the output of the following pseudocode?Integer j, m Set m = -1 Integer a[5] = { 3, 0, 1, 0, 2 } For(each j from m+1 to m+5) If(a[j] & j) a[j] = a[j] & j End If End For m=a[0] + a[4] - a[1] Print mQuestion 75AnswerA.5B.4C.15D.8
What will be the output of the following pseudocode?Integer p, q, r, s Set p=1, q = 1for (each r from 0 to 2 ) for (each s from -4 to -2 ) p = p + 2if(p > r) Continue End if p = 1if(p > s) Jump out of the loop End if End for End for Print p + qQuestion 83AnswerA.13B.24C.35D.20
What will be the output for the following code?i=0while(i<3): j=0 while(j<3): print(i,j,end=" ") j+=1 print()
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.