what is the logic to print the following pattern using only 2 loops??
C / C++ / MFC
1
Posts
1
Posters
1
Views
1
Watching
-
* * ** ** ***** ** ** * * on what basis, logical statement should be given in if's column... (the pattern is not accurately displayed by this web page...consider a 5x5 matrix in which 12,13,14,23,43,52,53,54 are to filled with blank spaces, rest of them with *'s. int main() { int n, a, b; printf("\nEnter no of rows: "); scanf_s(" %d", &n); for (a = -n; a <= n; a++,printf("\n")) { if (n <= 0) n = -n; for (b = 1; b <= (2*n)+1; b++) { if () printf(" "); else printf(" * "); } } return 0; }