Skip to content

Tag Archives: Loops & Control Structure

A do… while loop in JavaScript is a control statement in which the code is allowed to execute continuously based on a given boolean condition.… Read More
Exit a Loop in C++: If the condition of an iteration statement (for, while, or do-while statement) is omitted, that loop will not terminate unless… Read More
While loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be… Read More
Range-Based ‘for’ loops have been included in the language since C++11. It automatically iterates (loops) over the iterable (container). This is very efficient when used… Read More
Nested loop means a loop statement inside another loop statement. That is why nested loops are also called as “loop inside loop“. Syntax for Nested… Read More
for loop: for loop provides a concise way of writing the loop structure. Unlike a while loop, a for statement consumes the initialization, condition and… Read More
for loop: for loop provides a concise way of writing the loop structure. Unlike a while loop, a for statement consumes the initialization, condition and… Read More
while loop: A while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while… Read More
The for_each_n() function was added in the C++17 technical specification. Its idea has been borrowed from the use of map in Python or Haskel. This… Read More
Looping in programming languages is a feature that facilitates the execution of a set of instructions/functions repeatedly while some condition evaluates to true. For example,… Read More
Prerequisite: Loops and String Note: Output of all these programs is tested on Python3 1. What is the output of the following? my_string = "geeksforgeeks"… Read More
Prerequisite: Loops Note: Output of all these programs is tested on Python3 1. What is the output of the following? mylist = ['geeks', 'forgeeks'] for… Read More
Prerequisite: Decision Control and Loops 1. What will be the output of the following program? class Test { public     static void main(String[] args)     {         int… Read More
Apart from the generic looping techniques, such as “for, while and do-while”, C++ in its language also allows us to use another functionality which solves… Read More
#include<stdio.h> int main() {     int a = 5;     switch(a)     {     default:         a = 4;     case 6:         a--;     case 5:         a = a+1;     case 1:         a… Read More

Start Your Coding Journey Now!