Computer Science, asked by mousumichattopadhyay, 10 months ago

Find the output of the snippet:
int a[]={1,2,3,4,5,6};
for (i=0;i<5;i++)
{
a[i]=a[a+1]+a[i];
a[i+1]=a[i]-a[i+1];
a[i]=a[i]-a[i+1];
}
for(i=0;i<6;i++)
{
System.out.print(a[i]);
}

Answers

Answered by SubramanyaManjunath
1
Error because variable “i” isn’t initialised.

Int i =0;
After declaring array or before.
Similar questions