Which of the following two code segments is faster? Assume that compiler makes no optimizations.
/* FIRST */
for(i=0;i<10;i++)
  for(j=0;j&l...
Share
If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0” till “i &...
Share
Find the length of a string without using any loops and string.h in C. Your program is supposed to behave in following way:
Enter a string: GeeksforGeeks (Say user e...
Share
Loops in programming comes into use when we need to repeatedly execute a block of statements. For example: Suppose we want to print “Hello World” 10 tim...
Share
Object oriented design started right from the moment computers were invented. Programming was there, and programming approaches came into the picture. Programming is ...
Share
Range-based for loop in C++ is added since C++ 11. It executes a for loop over a range. Used as a more readable equivalent to the traditional for loop operating over ...
Share
Following is a C++ program that prints 1 to 100 without loop and without recursion.
#include <iostream>
using namespace std;
  
template<...
Share
It is possible to solve this problem using loop or a recursion method. And we have already seen the solution using #define directive (Macro expansion) but what if al...
Share
What is Object Oriented Programming?
Object Oriented Programming (OOP) is a programming paradigm where the complete software operates as a bunch of objects talking to...
Share
Looping in programming language is a way to execute a statement or a set of statements multiple number of times depending on the result of condition to be evaluated t...
Share