Hi frenz,

the above code runs perfect. But while printing the arrays x y z
the value of y[0]changes...could u plz help me in sorting this problem..
thank u..

this is the output..

x y z
1 -1 0
2 4 -2
3 3 0
4 2 2
5 1 4

Dave Sinkula commented: The posted code is nonstandard and likely does not even build on a modern standard compiler. -2

Recommended Answers

All 3 Replies

There is a mistake on line 8.

while(i++<5)                      // the first value you are dealing with is 1 not 0
result[i]=x[i]-y[i];

There is a mistake on line 8.

while(i++<5)                      // the first value you are dealing with is 1 not 0
result[i]=x[i]-y[i];

yeah..i know tat the array is processed from 1th element not 0th element...y does the value of y[0] changes ...

Repost your code. It got lost when correcting the post -- it's not a Code Snippet.

What was the value of y[0] before? What does it change to?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.