Answer:
Written in Java
public static void printChars(char ch1, char ch2, int numberPerLine){
int i = 1;
for(char A = ch1; A <= ch2; A++){
if(i<=numberPerLine){
System.out.print(A+" ");
i++;
}
else{
System.out.println();
i = 1;
}
}
}
Explanation:
This line defines the method
public static void printChars(char ch1, char ch2, int numberPerLine){
This line initializes the number of print out per line to 1
int i = 1;
The following is an iteration that prints from ch1 to ch2. Note that ch1 and ch2 are characters
for(char A = ch1; A <= ch2; A++){
The following if condition (italicized) checks if the number of print outs is up to the required length.
If No, the character is printed
If yes, a new line is printed.
<em> if(i<=numberPerLine){</em>
<em> System.out.print(A+" "); </em>
<em> i++;</em>
<em> }</em>
<em> else{</em>
<em> System.out.println();</em>
<em> i = 1;</em>
<em> }</em>
}
}
See attachment for full program including test of ten characters in a line