Home / Expert Answers / Computer Science / 8-write-a-segment-of-code-to-accomplish-the-following-15-points-a-declare-2-variables-named-num-pa441

(Solved): 8 Write a segment of code to accomplish the following. (15 points) a) Declare 2 variables named Num ...




8
Write a segment of code to accomplish the following. (15 points)
a) Declare 2 variables named Numl and Num2 of type integer
8 Write a segment of code to accomplish the following. (15 points) a) Declare 2 variables named Numl and Num2 of type integer. b) Accept 10 and 20 as the value of Num1 and Num2 from input stream (keyboard). c) Calculate the new values for Num 1 and Num 2 as follows: Num1 \( = \) Num1 \( +\left(10^{\circ} \mathrm{Num} 2\right) \) \( \mathrm{Num} 2=\mathrm{Num} 2+\left(10^{+} \mathrm{Num} 1\right) \) d) Make a comparison between Num1 and Num2 such that, if Num1 is greater than or equal to Num2 then display "COMPUTER SCIENCB"; otherwise display "MATHEMATICS".


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer : C++ code : #include using namespace std; int main() { int Num1 , Num2 ; // declare 2 integer variables
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe