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]

Random GK Questions

A Equal protection of the laws
B Freedom of speech
C Freedom of association
D Work and material security

View Answer

A Vijayalaya
B Rajendra
C Aditya – I
D Rajaraja – I

View Answer

A Tulughma system
B his military skill
C his cavalry
D Afghan's disunity

View Answer

A Herbivores
B Carnivores
C Omnivores
D Detritivores

View Answer

Your Valuable Comments Please...

Useful Computer Science EBooks