How_To_Add_Program_Run_Data_to_Listing

How_To_Add_Program_Run_Data_to_Listing - number1 =...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
How To Add Program Run Data to Listing 1. After the program runs, right click mouse on top bar of the black(DOS) screen, select edit, select mark see below. 2. A white cursor appears in upper left hand corner, with mouse drag it so that all of the run data is selected, that is, turns to white background instead of black. 3. Again, , right click mouse on top bar of the black(DOS) screen, select edit, select copy see below. Now you have successfully copied the run data to the Windows Clipboard.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4. Go to your listing in the Visual C++ Window, go to the end of the program and type “/*” then type “Ctrl v”. This will paste the run data to the end of your program. Finally type “/*” after the run data so that it is consider a long comment to the compiler. See below. // Fig. 3.14: Comparison.cpp // Using if statements, relational operators and equality // operators. #include "stdafx.h" #using <mscorlib.dll> using namespace System; int _tmain() { int number1, number2; Console::Write( S"Please enter first integer: " );
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: number1 = Int32::Parse( Console::ReadLine() ); Console::Write( S&quot;Please enter second integer: &quot; ); number2 = Int32::Parse( Console::ReadLine() ); if ( number1 == number2 ) Console::WriteLine( S&quot;\n{0} == {1}&quot;, number1.ToString(), number2.ToString() ); if ( number1 != number2 ) Console::WriteLine( S&quot;\n{0} != {1}&quot;, number1.ToString(), number2.ToString() ); if ( number1 &lt; number2 ) Console::WriteLine( S&quot;{0} &lt; {1}&quot;, number1.ToString(), number2.ToString() ); if ( number1 &gt; number2 ) Console::WriteLine( S&quot;{0} &gt; {1}&quot;, number1.ToString(), number2.ToString() ); if ( number1 &lt;= number2 ) Console::WriteLine( S&quot;{0} &lt;= {1}&quot;, number1.ToString(), number2.ToString() ); if ( number1 &gt;= number2 ) Console::WriteLine( S&quot;{0} &gt;= {1}&quot;, number1.ToString(), number2.ToString() ); return 0; } // end _tmain //RUN DATA FOLLOWING /* Please enter first integer: 12 Please enter second integer: 12 12 == 12 12 &lt;= 12 12 &gt;= 12 Press any key to continue */...
View Full Document

Page1 / 3

How_To_Add_Program_Run_Data_to_Listing - number1 =...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online