c program to print Square pattern containing stars
- #include<stdio.h>
- int main()
- {
- int i,j, n=5;
- //Logic to print square based on given value of N...
- for(i=0; i<n; i++)
- {
- for(j=0; j<n; j++)
- printf("* "); //one space in printf prints proper output
- printf("\n");
- }
- return 0;
- }
Output
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
Comments