chevron_left

Recent posts tagged loop

16 1 3 min.
In this article we will discuss all different types of loops and their usage in JavaScript. This is hopefully going to be very informative for those looking to use loops in JS but wondering which should they use or just want to learn about loops. If ...
posted Aug 31 ahsanhanif99 202 points
19 0 2 min.
Normally, you can iterate through all elements in an array, map, vector, … using the ordinary for-loop:#include <iostream> using namespace std; int main() { int arr[] = {1, 2, 3, 4, 5}; for(int i = 0; i < 5; i++) { cout &...
posted Aug 23 hhh98hd 226 points
6 0 0 min.
Question:which of the following statements declares alpha to be an array of 25 components of the type int?1. int alpha[25]; 2. int array alpha[25]; 3. int array alpha[25][25];4. int alpha[2][5]; Correct Answer: int alpha[25]; ...
posted Aug 15 SharadMagar450 320 points
9 0 1 min.
Want to repeat a YouTube video without having to click the "play" button? The site provides precisely a parameter to activate to play your video in a loop.If there is a video that you just can't live without on YouTube, then maybe you w...
posted Jul 25 amna 2,504 points
9 0 2 min.
**What is String in Java?** ----------------------- In general, String is a sequence of characters. In Java, however, the string represents the sequence of letters. The Java.lang.String section is used to build the thread. Scrolling through a Strin...
posted Jul 2 amna 2,504 points
12 1 3 min.
 Difference Between for and while loopn C++ and Java, the iteration statements, for loop, while loop and do-while loop, allow the set of instructions to be repeatedly executed, till the condition is true and terminates as soon as the condition b...
posted May 29 Sanjana Sagar 399 points
0 0 1 min.
We can also print the Java array using for-each loop. The Java for-each loop prints the array elements one by one. It holds an array element in a variable, then executes the body of the loop.The syntax of the for-each loop is given below:for(dat...
posted May 18 muliemes 0 points
0 0 5 min.
The for loop:for (let index=0; index < someArray.length; index++) {   const elem = someArray[index];   // ··· }The for-in loop:for (const key in someArray) {   console.log(key); } The Array method .forEach(): someArray.forEach((elem, index)...
posted Apr 25 Lelin 189 points
0 0 1 min.
C++ provides statements break and continue to alter the flow of the control. Given below I have explained how break can be used to terminate a switch statement’s execution. This article discusses how to use break in a repetition statement.Break...
posted Nov 27, 2020 Lalit Kumar 0 points
0 0 1 min.
In this article, we will learn different techniques to print the elements of a given array in Java.To understand this example, you should have knowledge of the following Java programming topics:·      &n...
posted Oct 9, 2020 Hasnain_khan 0 points
0 0 3 min.
Summary: apply Euclid's algorithm in the C language to obtain the greatest common divisor (GCF) of two numbers; implementing two functions:Table of contents: Greatest common factor in C.With while loop.Using recursion.Put...
posted Oct 4, 2020 amna 2,504 points
5 0 2 min.
In this post I will show you the solution to the following problem that occurs when programming in C:Table of contents:The problem.Compiler solution.Solution in code.file.c: 34: 5: error: 'for' loop initial declarations are only allowed in C9...
posted Oct 3, 2020 amna 2,504 points
0 0 1 min.
Random numbers play a major role in the programming field in terms of probability and equal distribution.Imagine a cards game where 4 players are playing a game of hearts, but the cards are always dealt in the same way, and favoring a player over ano...
posted Sep 12, 2020 Michel Maalouly 0 points
0 0 1 min.
Solution:for 'a' in string is not the proper way to look for cases of a in a string. The syntax for item in list needs item to be a variable, and you have a literal value instead, wh...
posted Jun 29, 2020 Tushar Shuvro 576 points
0 0 2 min.
 In this article, we are going to learn how to iterate through the string in C++?There are many ways to iterate over characters of a string in C++. To learn the ways, read the following article which is defining all the methods ahead.Methods&nbs...
posted May 8, 2020 Lalit Kumar 0 points
0 0 2 min.
Solution:Code: <h2>Convert HTML Form Values to JSON( click submit to display results )</h2> <div id="left"> <textarea id="results"></textarea> </div> <form id="test-form"> <table id='json-table'> ...
posted Apr 25, 2020 Tushar Shuvro 576 points
To see more, click for the full list of questions or popular tags.