Skip to content

Tag Archives: C-Loops & Control Statements

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
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
Prerequisite : Loops in C Q.1 What is the output of this program? #include <iostream> using namespace std; int main() {     int i, j, var… Read More
Prerequisite : Control StatementsQ.1 What is the output of this program?   CPP #include <iostream> using namespace std; int main() {     char i = 0;     for… Read More
Prerequisite : for loop Q.1 What is the output of this program? #include <iostream> using namespace std; int main() {     for (5; 2; 2)         printf("Hello\n");… Read More
Prerequisite: while loop in C/C++In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based… Read More
Prerequisite : While loops Q.1 What is the output of this program? #include <iostream> using namespace std; int main() {     unsigned int x = 3;… Read More
Short question based on c loops 1. What will be the output of the following code? #include <stdio.h> int main() {     int i = 0,… Read More
Below are some interesting facts about C programming: 1) The case labels of a switch statement can occur inside if-else statements. #include <stdio.h>    int… Read More
Prerequisite – Switch Statement in C Switch is a control statement that allows a value to change control of execution. // Following is a simple… Read More
In C++ switch statement, the expression of each case label must be an integer constant expression. For example, the following program fails in compilation.   CPP /*… Read More
Which of the following two code segments is faster? Assume that compiler makes no optimizations.   C /* FIRST */ for(i=0;i<10;i++)   for(j=0;j<100;j++)     //do something Python3 #… Read More
Question: Is there any example for which the following two loops will not work same way? /*Program 1 --> For loop*/ for (<init-stmnt>; <boolean-expr>; <incr-stmnt>) … Read More