RIYAD3403

Untitled

Aug 18th, 2017
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int m,n;
  5. printf("Enter number of rows and columns\n");
  6. scanf("%d %d",&m,&n);
  7. int a[m][n],i,j;
  8. for(i=0; i<m; i++)
  9. {
  10. for(j=0; j<n;j++)
  11. {
  12. if(i==j)
  13. {
  14. printf("0");
  15. }
  16. else if(j+i==n-1)
  17. {
  18. printf("0");
  19. }
  20.  
  21. else
  22. {
  23. printf("*");
  24. }
  25. }
  26. printf("\n");
  27. }
  28. return 0;
  29. }
Add Comment
Please, Sign In to add comment