hi i have question i know that this question is somehow nonsense but let see i have code to merge two sorted array in a one sorted array here is code in java
public class Merge {
public static void main(String[]args){
int a[]=new int[]{7,14,23,30,35,40};
int b[]=new int[]{5,8,9,11,50,67,81};
int c[]=new int[a.length+b.length];
int al=0;
int bl=0;
int cl=0;
while (al<a.length && bl<b.length)
if (a[al]<b[bl])
c[cl++]=a[al++];
else
c[cl++]=b[bl++];
while (al<a.length)
c[cl++]=a[al++];
while (bl<b.length)
c[cl++]=b[bl++];
for (int j=0;j<c.length;j++){
System.out.println(c[j]);
}
}
}
question is why does not work if we write here {} brackets
while (al<a.length && bl<b.length){
}
?