ARR - ARRAY(EASY)

no tags 

Replace "?" with a integer so that output is 4.

int main()
{
int arr[7];
int b,c,d,a;
a=4;
printf("%d",arr[?]);
return 0;
}

Input

No Input

Output

Write only one integer as the answer. And submit as TEXT.

Note:Dont submit whole program and assume no optimization by compiler.


hide comments
nadstratosfer: 2018-05-26 17:29:55

Useless problem. Last AC submission 4.5 years ago -- the number I get with every compiler gets WA here. Please delete this.

Ashutosh: 2011-04-12 12:24:53

Last edit: 2011-04-12 18:11:45
vivek yadav: 2011-01-25 16:53:41

at my my comiler it give correct output
but on spoj it give wrong answer.
why???

যোবায়ের: 2010-12-17 14:12:26

I use many different local and online compiler and could not manage it to print 4 with arr[x] where, x is the integer I got AC with, so, its all about "how compiler behaves" or more specifically "how compiler allocates memory" :p

.::Manish Kumar::.: 2010-11-09 05:24:17

Moved to tutorial.
I did not remove it, because it would draw attention towards how compiler behaves.

Varun Jalan: 2010-11-09 05:24:17

Move it to the tutorial section or even better remove it altogether. Firstly it does not test any particular feature of the C language, and is not standard. Also, some compilers would optimise and not allocate b,c,d, while some would.

Shaka Shadows: 2010-11-09 05:24:17

The problem has been designed considering just a particular compiler. Mine, which is gcc/g++ 4.4 never outputs 4 with the output value. So, a small hint: think as a compiler and forget about yours :)

zingoba: 2010-11-09 05:24:17

Last edit: 2010-12-16 18:19:57

Added by:.::Manish Kumar::.
Date:2010-11-08
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:TEXT
Resource:own problem