Problem-1
1 2 3 4 5 6 7 8 |
void DemoFunction(int n) { int i; int count = 0; for (i = 1; i * i < n; i++) { count++; System.out.println("*"); } } |
Problem-2
1 2 3 4 5 6 7 8 9 |
void DemoFunction(int n) { int i = 1; int s = 1; while (s <= n) { i++; s = s + i; System.out.println("@"); } } |