Rolf_2 15 Newbie Poster
class Sample {
  int num;
  void method() {
    num = 1; // Sample.num is set to 1
    int num = num = 2; // num in method is set to 2, the second num is num in method
    num = 3; // num in method is set to 3
  }
}

I tried the code in https://www.tutorialspoint.com/compile_cpp_online.php

class Sample {
  public:
    int num;
  int method() {
    num = 1;
    int num = num = 2;
    num = 3;
    return num;
  }
};
Sample s;
cout << s.num << endl; 
cout << s.method() << endl;
cout << s.num << endl; 

Output:
0
3
1

but your tag is Java, so it should be interpreted as Java code. I will try it in Java.

rproffitt commented: Nice work but you added code so my observation won't apply since you changed the code. +15
Rolf_2 15 Newbie Poster

try

for(i=c+1;i<=e;i++)
{
 a[i]=b[i-c];
}

instead of

for(i=c+1;i<=e;i++)
{
  for(j=1;j<=d;j++)
  {
       a[i]=b[j];  // this sets a[i]=b[d] because all settings a[i]=b[j] with j<d are overwritten by next j
  }
}

Please be aware that in C arrays are zero based i.e. array a begins with a[0] until a[9] with your declaration.
You should check that c, d and e are small enough to fit the array sizes.
Use better (i.e. self-explaining) names for your variables