Tag Archives: loop

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
Given a number N, the task is to print the star pattern in single loop. Examples:  Input: N = 9 Output: * * * *… Read More
Sentinel Controlled Loop A sentinel controlled loop is also called an indefinite repetition loop because the number of iterations is not known before the loop… Read More
Range-based for loops is an upgraded version of for loops. It is quite similar to for loops which is use in Python. Range-based for loop… Read More
Write a program that checks whether a given Linked List contains a loop and if a loop is present then returns the count of nodes… 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
Given an integer K, the task is to find the length of the smallest no. N which is divisible by K and formed by using… Read More
Given a string str. The task is to find the product of ASCII values of characters in the string. Examples: Input : str = "IS"… Read More
Given a number N, the task is to print the following pattern:- Examples:  Input : N = 4 Output : 4 4 4 4 4… Read More
Prerequisite: Loops Note: Output of all these programs is tested on Python3 1. What is the output of the following? filter_none edit close play_arrow link… Read More
Aim : Program to compute the sum of two matrices and then print it in Python. Examples: Input : X= [[1,2,3], [4 ,5,6], [7 ,8,9]]… Read More
  Given a linked list, check if the linked list has loop or not. Below diagram shows a linked list with a loop.     Recommended:… Read More
Given a pointer to a node to be deleted, delete the node. Note that we don’t have pointer to head node. Recommended: Please solve it… Read More