Sports GK Questions and Answers 2024 (Latest Updated)

Awards & Honours GK Questions 2024 (Latest Updated)

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

Advertisement
Article and Schedule Quiz Start Test!
DOWNLOAD CURRENT AFFAIRS PDF FROM APP
Assam Direct Recruitment Test Series

Computer Science Topics