Answer:
Written in Java
public static void printArray(int myarr[], String s){
for(int i = 0; i<myarr.length;i++){
System.out.print(myarr[i]+s);
}
}
Explanation:
This defines the static method alongside the array and the string variable
public static void printArray(int myarr[], String s){
The following iteration iterates through the elements of the array
for(int i = 0; i<myarr.length;i++){
This line prints each element of the array followed by the string literal
System.out.print(myarr[i]+s);
}
}
The method can be called from main using:
<em>printArray(myarr,s);</em>
Where myarr and s are local variables of the main