Recent questions tagged for-loop

3 3 votes
1 1 answer
188
188 views
What is the output of the below code snippet?for var1, var2 in (1,2),(3,4): print(var1 + var2, end = " ")(a) 4 6(b) 10(c) 3 7(d) TypeError
0 0 votes
1 1 answer
180
180 views
What is the output of the below code snippet?result = 0 list1 = [10,20,30] list2 = [1,2] for num in range(len(list1)): for num in range(len(list2)): result += list1[num] ...
8 8 votes
2 2 answers
302
302 views
What is the output of the following code?#include <stdio.h int main() { int i, j, sum = 0; for (i = 1; i <= 4; i++) { for (j = 1; j <= 5; j++) { if (j % i == 0) continue;...
1 1 vote
0 0 answers
703
703 views
i have 1 doubt regarding the initialization of highlighted portion.Will the value of ’k’ change at each iteration or it will remain same (whatever value assigned to it du...
0 0 votes
2 2 answers
1.7k
1.7k views
void main() { int i=6; for( i; i; i ) { printf(“%d”,i); } }
4 4 votes
1 answers 1 answer
2.2k
2.2k views
for(i=0;i<=n;i++){ for(j=0;j<=i2;j++){ for(k=0;k<=$\frac{n}{2}$;k++){ x=y+z;}}}How many times the x=y+z statement will execute?
To see more, click for the full list of questions or popular tags.