Answer:
public static void swapPairs(int[] a){
int len=a.length;
if(len%2 ==0){
for(int i=0; i<len; i=i+2){
a[i]=a[i+1];
a[i+1]=a[i];
int[] b={a[i]+a[i+1]};
}
}
if(len%2 !=0){
for(int j=0; j<len; j=j+2){
a[j]=a[j+1];
a[j+1]=a[j];
a[len-1]=a[len-1];
int[] b={a[j]+a[j+1]+a[len-1]};
}
}
}
public static void printArray(int[] a){
System.out.println(a);
}
Answer:
A string containing all lowercase letters and numerals and ending with a- Or D
Answer:
if(isalpha(passCode[0]))
{
passCode[0] = '_';
}
if(isalpha(passCode[1]))
{
passCode[1] = '_';
}
Explanation:
The first if statement uses isalpha() function which checks if the character passed in this function is an alphabet. If the character stored in 0-th position (which is the first position whose index is 0) of the variable passCode is an alphabet then it is replaced with the '_'
The next if statement checks if the second character in the passCode variable is an alphabet. This means the function isalpha() checks if the character stored in second position (index 1) of the variable passCode is an alphabet then it is replaced with the '_'
The complete activity with this chunk of code added and the output is attached in a screen shot.
Answer:
The answer is TRUE we use paint program to draw.
Explanation:
#swag
What do you mean????!?????