Multiplying two arrays












-2












$begingroup$


I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.



Main points:




  • How to make the scanf_s for both int a and int b in one "piece of code"

  • Any other suggestions for example what I should be wary of, should/shouldn't use etc.


Thanks for the help and also for bearing with me.



#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}


for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}

return 0;
}









share|improve this question









New contributor




Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 2




    $begingroup$
    "Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
    $endgroup$
    – Patrik Šoukal
    1 hour ago






  • 3




    $begingroup$
    Write appropriate test cases first to the best of your knowledge.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    @πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
    $endgroup$
    – Patrik Šoukal
    1 hour ago
















-2












$begingroup$


I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.



Main points:




  • How to make the scanf_s for both int a and int b in one "piece of code"

  • Any other suggestions for example what I should be wary of, should/shouldn't use etc.


Thanks for the help and also for bearing with me.



#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}


for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}

return 0;
}









share|improve this question









New contributor




Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 2




    $begingroup$
    "Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
    $endgroup$
    – Patrik Šoukal
    1 hour ago






  • 3




    $begingroup$
    Write appropriate test cases first to the best of your knowledge.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    @πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
    $endgroup$
    – Patrik Šoukal
    1 hour ago














-2












-2








-2





$begingroup$


I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.



Main points:




  • How to make the scanf_s for both int a and int b in one "piece of code"

  • Any other suggestions for example what I should be wary of, should/shouldn't use etc.


Thanks for the help and also for bearing with me.



#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}


for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}

return 0;
}









share|improve this question









New contributor




Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.



Main points:




  • How to make the scanf_s for both int a and int b in one "piece of code"

  • Any other suggestions for example what I should be wary of, should/shouldn't use etc.


Thanks for the help and also for bearing with me.



#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}

for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}


for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}

return 0;
}






c++ matrix






share|improve this question









New contributor




Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 12 mins ago









Toby Speight

23.8k639113




23.8k639113






New contributor




Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









Patrik ŠoukalPatrik Šoukal

11




11




New contributor




Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 2




    $begingroup$
    "Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
    $endgroup$
    – Patrik Šoukal
    1 hour ago






  • 3




    $begingroup$
    Write appropriate test cases first to the best of your knowledge.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    @πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
    $endgroup$
    – Patrik Šoukal
    1 hour ago














  • 2




    $begingroup$
    "Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
    $endgroup$
    – Patrik Šoukal
    1 hour ago






  • 3




    $begingroup$
    Write appropriate test cases first to the best of your knowledge.
    $endgroup$
    – πάντα ῥεῖ
    1 hour ago












  • $begingroup$
    @πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
    $endgroup$
    – Patrik Šoukal
    1 hour ago








2




2




$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago






$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago














$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago




$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago




3




3




$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago






$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago














$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago




$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago










2 Answers
2






active

oldest

votes


















2












$begingroup$

Don't put everything into one big main()



If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.



Avoid non-standard libraries



Here we have "stdafx.h" and scanf_s that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]).



Include what you use



We don't seem to use <cmath> anywhere, so let's drop that. We'll need <cstdlib> for std::printf() - or switch to C++ style output using <iostream>.



Avoid using the whole std namespace



The std namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std:: - it's intentionally very short.



Use C++ collections



It's easier to work with the C++ collection types such as std::array or std::vector than with raw (C-style) arrays (which decay to pointers when passed as function arguments).






share|improve this answer









$endgroup$





















    -1












    $begingroup$

    So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?



    #include <cstdlib>
    #include <iostream>
    #include <string>
    #include <array>

    int main()
    {
    std::array<int, 3> a;
    std::array<int, 4> b;
    std::array<int, 3> c;

    for (int j = 0; j != 4; j++)
    {
    for (int l = 0; l != 4; l++)
    {
    std::cout << "Zadej a[" << j << "," << l << "]: ";
    std::cin >> a;
    }
    }

    for (int j = 0; j != 4; j++)
    {
    for (int l = 0; l != 4; l++)
    {
    std::cout << "Zadej b[" << j << "," << l << "]: ";
    std::cin >> b;
    }
    }

    for (int j = 0; j != 3; j++)
    {
    for (int l = 0; l != 3; l++)
    {
    ;
    std::printf(" |%d| ", c += a * b);
    }
    std::printf("n");
    }

    return 0;
    }





    share|improve this answer








    New contributor




    Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






    $endgroup$









    • 1




      $begingroup$
      Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
      $endgroup$
      – Sᴀᴍ Onᴇᴌᴀ
      12 mins ago











    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "196"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f211634%2fmultiplying-two-arrays%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2












    $begingroup$

    Don't put everything into one big main()



    If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.



    Avoid non-standard libraries



    Here we have "stdafx.h" and scanf_s that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]).



    Include what you use



    We don't seem to use <cmath> anywhere, so let's drop that. We'll need <cstdlib> for std::printf() - or switch to C++ style output using <iostream>.



    Avoid using the whole std namespace



    The std namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std:: - it's intentionally very short.



    Use C++ collections



    It's easier to work with the C++ collection types such as std::array or std::vector than with raw (C-style) arrays (which decay to pointers when passed as function arguments).






    share|improve this answer









    $endgroup$


















      2












      $begingroup$

      Don't put everything into one big main()



      If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.



      Avoid non-standard libraries



      Here we have "stdafx.h" and scanf_s that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]).



      Include what you use



      We don't seem to use <cmath> anywhere, so let's drop that. We'll need <cstdlib> for std::printf() - or switch to C++ style output using <iostream>.



      Avoid using the whole std namespace



      The std namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std:: - it's intentionally very short.



      Use C++ collections



      It's easier to work with the C++ collection types such as std::array or std::vector than with raw (C-style) arrays (which decay to pointers when passed as function arguments).






      share|improve this answer









      $endgroup$
















        2












        2








        2





        $begingroup$

        Don't put everything into one big main()



        If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.



        Avoid non-standard libraries



        Here we have "stdafx.h" and scanf_s that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]).



        Include what you use



        We don't seem to use <cmath> anywhere, so let's drop that. We'll need <cstdlib> for std::printf() - or switch to C++ style output using <iostream>.



        Avoid using the whole std namespace



        The std namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std:: - it's intentionally very short.



        Use C++ collections



        It's easier to work with the C++ collection types such as std::array or std::vector than with raw (C-style) arrays (which decay to pointers when passed as function arguments).






        share|improve this answer









        $endgroup$



        Don't put everything into one big main()



        If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.



        Avoid non-standard libraries



        Here we have "stdafx.h" and scanf_s that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]).



        Include what you use



        We don't seem to use <cmath> anywhere, so let's drop that. We'll need <cstdlib> for std::printf() - or switch to C++ style output using <iostream>.



        Avoid using the whole std namespace



        The std namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std:: - it's intentionally very short.



        Use C++ collections



        It's easier to work with the C++ collection types such as std::array or std::vector than with raw (C-style) arrays (which decay to pointers when passed as function arguments).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        Toby SpeightToby Speight

        23.8k639113




        23.8k639113

























            -1












            $begingroup$

            So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?



            #include <cstdlib>
            #include <iostream>
            #include <string>
            #include <array>

            int main()
            {
            std::array<int, 3> a;
            std::array<int, 4> b;
            std::array<int, 3> c;

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej a[" << j << "," << l << "]: ";
            std::cin >> a;
            }
            }

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej b[" << j << "," << l << "]: ";
            std::cin >> b;
            }
            }

            for (int j = 0; j != 3; j++)
            {
            for (int l = 0; l != 3; l++)
            {
            ;
            std::printf(" |%d| ", c += a * b);
            }
            std::printf("n");
            }

            return 0;
            }





            share|improve this answer








            New contributor




            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            $endgroup$









            • 1




              $begingroup$
              Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
              $endgroup$
              – Sᴀᴍ Onᴇᴌᴀ
              12 mins ago
















            -1












            $begingroup$

            So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?



            #include <cstdlib>
            #include <iostream>
            #include <string>
            #include <array>

            int main()
            {
            std::array<int, 3> a;
            std::array<int, 4> b;
            std::array<int, 3> c;

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej a[" << j << "," << l << "]: ";
            std::cin >> a;
            }
            }

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej b[" << j << "," << l << "]: ";
            std::cin >> b;
            }
            }

            for (int j = 0; j != 3; j++)
            {
            for (int l = 0; l != 3; l++)
            {
            ;
            std::printf(" |%d| ", c += a * b);
            }
            std::printf("n");
            }

            return 0;
            }





            share|improve this answer








            New contributor




            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            $endgroup$









            • 1




              $begingroup$
              Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
              $endgroup$
              – Sᴀᴍ Onᴇᴌᴀ
              12 mins ago














            -1












            -1








            -1





            $begingroup$

            So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?



            #include <cstdlib>
            #include <iostream>
            #include <string>
            #include <array>

            int main()
            {
            std::array<int, 3> a;
            std::array<int, 4> b;
            std::array<int, 3> c;

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej a[" << j << "," << l << "]: ";
            std::cin >> a;
            }
            }

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej b[" << j << "," << l << "]: ";
            std::cin >> b;
            }
            }

            for (int j = 0; j != 3; j++)
            {
            for (int l = 0; l != 3; l++)
            {
            ;
            std::printf(" |%d| ", c += a * b);
            }
            std::printf("n");
            }

            return 0;
            }





            share|improve this answer








            New contributor




            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            $endgroup$



            So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?



            #include <cstdlib>
            #include <iostream>
            #include <string>
            #include <array>

            int main()
            {
            std::array<int, 3> a;
            std::array<int, 4> b;
            std::array<int, 3> c;

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej a[" << j << "," << l << "]: ";
            std::cin >> a;
            }
            }

            for (int j = 0; j != 4; j++)
            {
            for (int l = 0; l != 4; l++)
            {
            std::cout << "Zadej b[" << j << "," << l << "]: ";
            std::cin >> b;
            }
            }

            for (int j = 0; j != 3; j++)
            {
            for (int l = 0; l != 3; l++)
            {
            ;
            std::printf(" |%d| ", c += a * b);
            }
            std::printf("n");
            }

            return 0;
            }






            share|improve this answer








            New contributor




            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer






            New contributor




            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 33 mins ago









            Patrik ŠoukalPatrik Šoukal

            11




            11




            New contributor




            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Patrik Šoukal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.








            • 1




              $begingroup$
              Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
              $endgroup$
              – Sᴀᴍ Onᴇᴌᴀ
              12 mins ago














            • 1




              $begingroup$
              Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
              $endgroup$
              – Sᴀᴍ Onᴇᴌᴀ
              12 mins ago








            1




            1




            $begingroup$
            Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
            $endgroup$
            – Sᴀᴍ Onᴇᴌᴀ
            12 mins ago




            $begingroup$
            Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
            $endgroup$
            – Sᴀᴍ Onᴇᴌᴀ
            12 mins ago










            Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.













            Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.












            Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Code Review Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f211634%2fmultiplying-two-arrays%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python