Join our Telegram Channel

8000+ STATIC GK MCQs for SSC/ Railway/ PSC
1000 POLITICAL SCIENCE MCQS | EBook
Get 22 nos. GK EBooks | Combo Pack
Current Affairs Monthly Magazine -Subscribe Now!
1000 BIOLOGY MCQS AND ANSWERS | EBook
1000 ECONOMICS MCQS FOR EXAMS | EBook
Mughal Empire MCQs | EBook
ECONOMIC GEOGRAPHY MCQs | EBook
350 MCQs ON INDIAN CONSTITUTION | EBook

Question

How long the following loop runs?

	for(x=0;x=3;x++)
	
A Three times
B Four times
C Forever
D Never
Answer & Explanation
Option: [D]

The first statement of a for loop is initialize the loop counter, second is conditional statment and the third one is increment/decrement of the loop counter.

In the given expression the second statement is an assignment statement instead of condition.

So the for loop never execute.

Advertisement
Advertisement

General Knowledge

Month-wise Current Affairs 2022

Category-wise Current Affairs

Jobs by Qualification

Free Mock Test