127k views
4 votes
17. Consider a scenario in which you develop a C++ program on a computer that has a Pentium processor and compile the program into the corresponding machine language. What step should you take to run the same program on a computer that has a different processor?

1 Answer

4 votes

Answer:

"There is need to compile the program again on a different processor." is the correct answer for the above scenerio.

Step-by-step explanation:

  • The c++ program is a platform-dependent program because it is covered on a machine language directly and machine language programs are dependent programs. While in the case of java programming there is an object code that is converted from the class code and it is compatible with the other machine.
  • The dependent program states the meaning that if a program is developed by the one machine then it can not be executed on the other machine
  • The above question asked about the compiled c++ program that it can execute on another machine, which answer is no. if a user wants to execute the c++ program for the other processor then, he needs to compile the program again on the other machine.

User Vivere
by
5.9k points