c# - multiplication table using two nested loops but i am getting an error -
i trying create table like...
desired:
but code coming out like..
actual:
my code:
static void main(string[] args) { (int = 0; <= 9; i++) { console.write(i + "\t"); (int j = 1; j <= 9; j++) { if (i > 0) console.write(i * j + "\t"); else console.write(j + "\t"); } console.write("\n"); } console.readkey(); }
how add *
, -, |
?
(int = 0; <= 9; i++) { if (i == 0) { console.write("*\t | \t"); } else { console.write(i + "\t | \t"); } (int j = 1; j <= 9; j++) { if (i > 0) { console.write(i * j + "\t"); } else { console.write(j + "\t"); } } console.write("\n"); if (i == 0) { console.writeline("-------------------------"); } }
Comments
Post a Comment