Gifted Points (III)

1
2
3
float index=1;
int Z[]={9, Z[0]*11, 3, 8};
cout<<Z[int(index)]<<"\n";

What does Z[int(index)] return in the C++ code given above?

Enter 999 as your answer if the results display any error.


this problem is a part of the set Fundamental Programming


The answer is 99.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Hint: C++ array index would be start from 0

Vijay Kumar
Jan 30, 2016

int(1)=1 Z [ 1 ] = ( Z [ 0 ] 11 ) = 9 11 = 99 Z[1]=(Z[0]*11)=9*11=99

It's not always for the results :)

Zeeshan Ali - 5 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...