some help porograming c++ (word length on host machine) and (matrices)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Abdulrahman
    New Member
    • Dec 2013
    • 2

    some help porograming c++ (word length on host machine) and (matrices)

    please I have an exam to write a program about 2 questions

    Q1:Design, develop and execute a program in VCH to compute and print the word length th on host machine?

    Q2:Design, develop and execute a program in read two A (MXN) to Q) and compute the product ofA and B ifthe matrices are compatible for The multiplication. program must print the input matrices and the resultant matrix with suitable headings and format if the matrices are compatible for multiplication, otherwise the program must print a be suitable (For the purpose ofdemonstration , the array sizes MMP, and Q can all message. less than or equal to 3?
  • aselvan07
    New Member
    • Dec 2013
    • 4

    #2
    I don't think people would honor a request like that. Providing more specific questions might be beneficial.

    Comment

    • Abdulrahman
      New Member
      • Dec 2013
      • 2

      #3
      you are right bro

      i was writing the first question i got some mistake the program looks good but there's nothing come out

      Code:
      #include<iostream>
      using namespace std;
       main()
      {
      	int var = -1,wordlen=0;
      	while (var)
      	{
      		wordlen++;
      	var = 1;
      	}
      	cout <<" The Word length of this Host Machine is" <<var <<"Bits." ;
      
      	return 0;
      
      }
      Last edited by Rabbit; Dec 29 '13, 09:27 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.

      Comment

      • aselvan07
        New Member
        • Dec 2013
        • 4

        #4
        Two things:
        1. Main function doesn't have a return type, but returns 0. Change return type to int.
        2. It looks like the while loop is an infinite loop I.e, the loop doesn't stop. You probably want to check for some condition and break out of the loop.

        Comment

        • weaknessforcats
          Recognized Expert Expert
          • Mar 2007
          • 9214

          #5
          First is the host machine.

          Next is a C/C++ compiler that implements some kind of syntax.

          So how do you propose to find the word length of the hardware when the hardware is not connected to C or C++?

          There are several layers of abstraction (aka virtual machines) between C/C++ and the metal.

          Or, more generally, can you define the word length of the host machine in English?

          None of this has anything to do with matrix multiplication.

          Because there are two questions on this thread I am closing the thread. Please create new threads and only one question per thread . Please.

          Comment

          Working...