Advertisement
Guest User

array

a guest
Dec 11th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int A[10][10];
  8. int B[10][10];
  9. int C[10][10];
  10. int n,m;
  11. cout<<"input mariks A= ";
  12. for (int n=1; n<=2; n++){
  13. for (int m=1; m<=2; m++){
  14. cout<<"nilai A["<<n<<"]["<<m<<"]=";
  15. cin>> A[n][m];
  16. }
  17. }
  18. cout<<"input mariks B= ";
  19. for (int n=1; n<=2; n++){
  20. for (int m=1; m<=2; m++){
  21. cout<<"nilai B["<<n<<"]["<<m<<"]=";
  22. cin>> B[n][m];
  23. }
  24. }
  25. cout<<"hasil jumlah mariks A B C= ";
  26. for (int n=1; n<=2; n++){
  27. for (int m=1; m<=2; m++){
  28. C[n][m]=A[n][m] * B[n][m];
  29. cout<< C[n][m]<<" ";
  30. }
  31. cout<<"\n";
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement