Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(void)
  6. {
  7.  
  8. int A[3][3];
  9.  
  10. for (int i = 0; i < 3; ++i) {
  11. for (int j = 0; j < 3; ++j) {
  12. cout << "Give value: ";
  13. cin >> A[i][j];
  14. }
  15. }
  16.  
  17.  
  18. cout << "Now print all the values of the A-array..." << endl << endl;
  19.  
  20. for (int i = 0; i < 3; ++i) {
  21. for (int j = 0; j < 3; ++j) {
  22. cout << A[i][j] << " ";
  23. }
  24. cout << endl;
  25. }
  26.  
  27.  
  28. return 0;
  29. }
  30.  
  31.  
  32.  
  33. /**********/
  34. /* OUTPUT */
  35. /**********/
  36.  
  37. $ ./a.out
  38. Give value: 1
  39. Give value: 2
  40. Give value: 3
  41. Give value: 4
  42. Give value: 5
  43. Give value: 6
  44. Give value: 7
  45. Give value: 8
  46. Give value: 9
  47. Now print all the values of the A-array...
  48.  
  49. 1 2 3
  50. 4 5 6
  51. 7 8 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement