public class MyClass {
public static void printChar(char ch1, char ch2, int numberPerLine){
int i = 0;
for (char c = ch1; c <= ch2; c++){
while (i < numberPerLine){
System.out.print(c + " ");
i += 1;
}
System.out.println("");
i = 0;
}
}
public static void main(String args[]) {
printChar('a', 'z', 10);
}
}
So far, this works by printing letters. If you need me to modify the code, I will.
Answer:
Explanation:
try
clc
clear
close all
x=linspace(0,2*pi,7);
z=cos(pi.*x./3)
% the output on mine is to 4 decimals so it looks a bit different than what the output on your example is , but, I think if you change the format to decimal 2 it will look the same :)