Please enter your email:

1. Which loop prints squares of 1–5?

for(i = 1; i <= 5; i++)
printf(“%d “, ?);

 
 
 
 

2. Which loop prints reverse table of 5 (50,45,…,5)?

for(i = 10; i >= 1; i–)
printf(“%d “, ?);

 
 
 
 

3. Which loop stops completely when i==5?

for(i = 1; i <= 10; i++) {
if(i == 5)
?;
printf(“%d “, i);
}

 
 
 
 

4. Which loop prints multiplication of numbers 1–5?

prod = 1;
for(i = 1; i <= 5; i++)
?;

 
 
 
 

5. What will be output?

for(i = 1; i <= 3; i++)
for(j = 1; j <= 2; j++)
printf(“%d%d “, i, j);

 
 
 
 

6. Which loop prints table of 5?

for(i = 1; i <= 10; i++)
printf(“%d “, ?);

 
 
 
 

7. Output of this code?

for(i = 1; i <= 5; i++) { }
printf(“%d”, i);

 
 
 
 

8. Which loop skips printing 5?

for(i = 1; i <= 10; i++) {
if(i == 5)
?;
printf(“%d “, i);
}

 
 
 
 

9. Which loop prints 10,20,…,100?

for(i = 10; i <= 100; ?)
printf(“%d “, i);

 
 
 
 

10. Which condition prints numbers 1,2,3,…,100?

for(i = 1; ? ; i++)
printf(“%d “, i);

 
 
 
 

Question 1 of 10

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat Icon