Sports GK Questions and Answers 2024 (Latest Updated)

Awards & Honours GK Questions 2024 (Latest Updated)

Question

Given the following code fragment:

	main()
	{
		int row[20],i,sum=0;
		int *p=row;
		for(i=0;i<20;i++)
			*(p+i)=1;
		for(i=0;i<20;i+=sizeof(int))
			sum+=*(p+i);
		printf("sum=%d\n",sum);
	}
	

What will be the result of execution?

A sum=10
B sum=40
C sum=60
D sum=190
Answer & Explanation
Option: [A]
Advertisement
Article and Schedule Quiz Start Test!
DOWNLOAD CURRENT AFFAIRS PDF FROM APP
Assam Direct Recruitment Test Series

Computer Science Topics