Using for loop construct the same code piece can be repeated a fixed number of times.
We use a for loop to sum numbers from 1 to 10. This can changed to any other range also.
We use a while loop to sum numbers from values filled in begin and end.
Comparing simple for and while loop with a simple number printing example
Printing odd number series by incrementing counter in double step using for loop
Printing odd number series by testing divisibility test on each number in the for loop
A demonstration program to show how multiple initialisation and multiple step instructions in for loop can be used
As user enters a lower case or upper case alphabet the program prints from that alphabet till z.
As user enters a lower case or upper case alphabet the program prints from that alphabet till z using the faster technique of while loop iteration and checking for outside boundary condition
A program that finds the factorial of a program and checks the limit of number when incorrect outputs may occur due to data size.
This program sums the user inputs continuously and if user input 0 it terminates the loop and displays the sum.
Use of do-while loop to redo or re-perform a program activity using a do-while loop. Here we shall redo the activity of printing a number table.
Write a c++ program to collect a positive integer value from the user and pri
Write a c++ program to ask an integer number from the user and then print all
Write the output of the following code. Assume that required header files are
Write a c++ program to print ascii codes and given printable characters from
Instead of sending his secret code a programmer tells his friend that my secr
Write a c++ program to output the square and square roots of a number in a ra
Write a c++ program to power a base number with the given exponent by using a
Write a program to repeat the character as given by the user for number of ti
Solve the following program to show its output. Assume that required header f
Write the following program again using the while loop instead of for loop
A student has written this program¬†to sum natural numbers from 1 to 10. His¬
Identify errors in the following program. assume that appropriate header file
Write the output of the following code. Assume all header files are included.
Rewrite the following program after removing possible compiler errors. Mark e