Join our Telegram Channel

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
GENERAL AWARENESS COMBO (6 EBOOKS)

Question

What is the effect of the following code?

	main()
	{
		int a[4]={1,5};
		printf("%d",a[3]);
	}          
	
A 0
B Syntax error because of improper initialization
C 5
D Syntax error because of invalid index
Answer & Explanation
Option: [A]

Given that int a[4]={1,5}

So a[2], a[3] etc. are 0

Share this content with your friends
Advertisement

Month-wise Current Affairs 2022

Category-wise Current Affairs

Jobs by Qualification

Free Mock Test