Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
CPP All : Simple Loops
Concept Learning Code Sheets

Repeating a message with for loop #1982

Using for loop construct the same code piece can be repeated a fixed number of times.

Sum of natural numbers within a range – for loop #1986

We use a for loop to sum numbers from 1 to 10. This can changed to any other range also.

Sum of natural numbers within a range – while loop #1989

We use a while loop to sum numbers from values filled in begin and end.

Print table of an integer number #1992

Printing the table of an integer number like 5×1=5, 5×2=10, 5×3=15 and so on.

For and while loop comparison #1995

Comparing simple for and while loop with a simple number printing example

Odd number series with double step counter – for loop #1997

Printing odd number series by incrementing counter in double step using for loop

Odd number series with divisibility test – for loop #1999

Printing odd number series by testing divisibility test on each number in the for loop

Multiple initialisation and multiple step instructions in for loop #2003

A demonstration program to show how multiple initialisation and multiple step instructions in for loop can be used

Print till Z with loop count calculation #2034

As user enters a lower case or upper case alphabet the program prints from that alphabet till z.

Print till Z with while loop boundary crossing #2038

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

Factorial program with limit checking and digit series printing #2042

A program that finds the factorial of a program and checks the limit of number when incorrect outputs may occur due to data size.

Continuous sum using do-while exit on 0 input #2061

This program sums the user inputs continuously and if user input 0 it terminates the loop and displays the sum.

Redo of program activity using a do-while loop #2064

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.

Solved Problems

Sum of natural numbers up to a value given by the user. #2005

Write a c++ program to collect a positive integer value from the user and pri

Print all divisors and count of divisors #2016

Write a c++ program to ask an integer number from the user and then print all

Output writing – double increment in loop #2031

Write the output of the following code.

Printable ascii codes #2045

Write a c++ program to print ascii codes and given printable characters from

Secret code with alphabet divisible by five #2047

Instead of sending his secret code a programmer tells his friend that my secr

Square and square root of numbers in a range #2049

Write a c++ program to output the square and square roots of a number in a ra

Powering a number using a loop #2053

Write a c++ program to power a base number with the given exponent by using a

Repeating a character using loop #2218

Write a program to repeat the character as given by the user for number of ti

Output writing – loop with unary operators in cout chain #2346

Solve the following program to show its output.

For to while conversion #3001

Write the following program again using the while loop instead of for loop

Suggesting Error Corrections in Natural Number Addition #3221

A student has written this program to sum natural numbers from 1 to 10. HisÂ


Code Sheets:13  Solved Problems:11 
Back