Switch statement is used instead of if statement using if statement multiple time can replace with switch and this make program short. Break statement is used break that code proceed next like for loop i set to run 5 time and i write break it only run 1 time it skip braces part and continue to rest of code. Its used in loops and switch...
To make an Equilateral trianglewe need total three looptwo loop inside one loop. It will print Equilateral Triangle using word xx Check Out Program for Better Understand.
Program : Show Sqaures of Number This program first take input from user that an integer value and show the squares of term upto the number that enter by user like if i enter 2 then it display square of 1 and 2 and if i enter any number its show squares upto that term...
Loop means to repeat again and again. In C++ there are three loops that While loop, do-While loop & For loop. In C++ loop continues while a condition is true. When condition becomes false, the loop ends and control passes to the statements following the loop.