GkSeries.com

Q.

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]

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

Please share this page

Click Here to Read more questions

Teacher Eligibility Test