3 views
24 Jan 2026
do-while loop by showing menu (1.Add, 2.Subtract, 3.Exit). Take choice input and perform operation. At the exit the loop breaks. Benefit of at-least-once execution....
3 views
24 Jan 2026
Create a simple loop that adds 100 numbers. Then unroll them - 4 operations per iteration. Performance should theoretically be better....
2 views
24 Jan 2026
Print 10x10 multiplication table from nested loop properly formatted. Columns remain aligned. Outer loop rows, inner loop columns....
1 views
24 Jan 2026
Create infinite loop by using while(1). Check other conditions and exit with break on specific condition. Example of multiple exit points....
2 views
24 Jan 2026
Print Fibonacci series of n terms using loop (not recursion). Do variables maintaining same as for previous two numbers. Space-efficient approach....
3 views
24 Jan 2026
There are numbers in the Array. Loop in:
Break at negative number (stop completely)
Zero on continue (skip current iteration)
Demonstrate the effect of both by printing positive numbers.
...
3 views
24 Jan 2026
Print Armstrong numbers from 1 to 1000 (153 = 1³+5³+3³). Nested logic: extract outer loop numbers, inner loop digits and calculate power....
2 views
24 Jan 2026
Two 2D arrays (matrices) input. Multiply with nested loops. Logic: result[i][j] = sum of (a[i][k] * b[k][j]). Complex example of triple nested loop.
...
2 views
24 Jan 2026
Print all the prime numbers in the given range. Outer loop iterate numbers, inner loop divisibility check. Optimization: √n ...
2 views
24 Jan 2026
Take row input from the user. Print a pattern using nested loops that increment the number of stars in each row. Then modify it to decrement it. Mastery of loop control....