• Register

Recent posts tagged for-loop

21 2 2 min.
​Саn  yоu  hаve  а  fоr  lоор  inside  а  while  lоор Yes,  We  саn  рut  а  fоr  lоор  inside  а  while  lоор  оr  а  dо-while  l...
posted 3 days ago sakshi 603 points
22 3 2 min.
Here we study about how to write a C++ program to find largest and smallest of n numbers.#include<iostream> using namespace std; int main () { int arr[10], n, i, max, min; cout << "Enter the size of the array : "; cin >...
posted Jun 11 Jeevani 278 points
27 1 2 min.
In this program, we need to find the duplicate characters in the string.To find the duplicate character from the string, we count the occurrence of each character in the string. If count is greater than 1, it implies that a character has a duplicate ...
posted Jun 10 Jeevani 278 points
0 2 2 min.
I will start by explaining how a for loop works. A for loop is one of the easiest loops to use, you usually use it when you already know for how long or how many times you want the loop to go through the codes that you have provided. A for loop is co...
posted May 2 Tegra Balonga 500 points
3 0 1 min.
The break statement is used for  iterrupting flow of a loop, i.e. for, while. These loops are mostly used for iterating the list of elements, array, lists, tuples. The reason to this issue is simple and it happens quite often.Syntax:   ...
posted Jan 24 IamAdinath 100 points
0 0 1 min.
In this article, I am going to explain how to assign values to an array in java by using for loop. One can use many techniques to assign values to arrays but I will be using Scanner class.ApproachIn the below program, I have declared a class Demo and...
posted Nov 4, 2020 MallikaShaik672 500 points
0 0 2 min.
In this article, I am going to explain to how to break out of for loop under normal conditions and other circumstances. Below examples illustrate well about the for loop.For Loop in javaA for loop in java or any other programming languages basically ...
posted Oct 23, 2020 MallikaShaik672 500 points
0 0 2 min.
 Python is an interpreted, object-oriented, high-level programming language. It has simple and easy syntax just like the English language. So, In this tutorial, we are doing to discuss the difference between while and for loop in python. Wh...
posted Oct 22, 2020 Prasandeep Gautam 190 points
0 0 3 min.
This is the most important question because many interviewers asked this question that how to reverse a string. So if you are a python on an then you need to know we can reverse the string in Python.So, here we have created a tutorial on this topic a...
posted Oct 19, 2020 Prasandeep Gautam 190 points
13 0 1 min.
We can use a program for creating tables in an app related to databases or spreadsheets. So now we understand the need for tables in software. In this article, we are going to learn how to create a table in C++? And creating tables in C++ is pretty e...
posted Jun 1, 2020 Lalit Kumar 1,240 points
0 0 2 min.
Solution:STEP 1: Though it is not a conventional way however you can try this codefor($i=0;$i<count($data);$i++) { echo('<tr>'); echo('<td>' . $data[$i][0] . '</td>'); echo('<td>' . $data[$i][1] . '</td>'); ec...
posted May 19, 2020 Tushar Shuvro 31,696 points
31 2 1 min.
I got a problem with my textbook under the for-loop chapter. It’s saying something like this:Write a loop that sets newscores to oldscores shifted once left, with element 0 copied to the end. ex: if oldscores = {10, 20, 30, 40}, then  news...
posted Mar 19, 2020 Naymulhasan 94,291 points
To see more, click for the full list of questions or popular tags.