Advertisement
Norbysweg

5

Sep 19th, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a[50][50],n,x;
  8. cout<<"n= ";
  9. cin>>n;
  10. x=0;
  11. for (int i=0;i<n;i++)
  12. {
  13. for (int j=0;j<n;j++)
  14. {
  15. a[i][j]=x;
  16. x=x+2;
  17. }
  18. }
  19.  
  20. for (int i=0;i<n;i++)
  21. {
  22. for (int j=0;j<n;j++)
  23. {
  24. cout<<a[i][j]<<" ";
  25. }
  26. cout<<endl;
  27. }
  28.  
  29.  
  30.  
  31. return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement