Syntax vs Semantics

The following piece of code is written in C++.

0 1 2 3 4 5 Garbage Values alone Incorrect Code, will not execute 0 1 2 3 4 5 followed by zeroes 0 1 2 3 4 5 followed by Garbage values

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.

1 solution

Sameer Kolhar
May 4, 2018

The array is of size 6 and we're trying to print up to 30 values and because memory locations beyond the scope of the array will either be empty or used for some other process and hence we'll have both zeroes and garbage values as part of our output.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...