int a = 0;
if(a == 1) {
int b = 0; // this int b is only visible within this if statement only(Scope)
}
if(a == 1) {
b = 1; // here b can't be identify
}
you have to do following way to make correct the error
int a = 0;
int b = 0;
if(a == 1) {
b=0;
}
if(a == 1) {
b = 1;
}