Display the sum and difference of two rational numbers
What will be an ideal response?
```
int main()
{
int numer1, denom1, numer2, denom2;
int ansNumer, ansDenom;
getRational( numer1, denom1 );
getRational( numer2, denom2 );
//display original rationals
displayRational( numer1, denom1 );
cout << " ";
displayRational( numer2, denom2 );
cout << endl << endl;
//display sum
addRational( ansNumer, ansDenom, numer1, denom1, numer2, denom2 );
displayRational( numer1, denom1 );
cout << " + ";
displayRational( numer2, denom2 );
cout << " = ";
displayRational( ansNumer, ansDenom );
cout << endl << endl;
//display difference
subtractRational( ansNumer, ansDenom, numer1, denom1,
numer2, denom2 );
displayRational( numer1, denom1 );
cout << " - ";
displayRational( numer2, denom2 );
cout << " = ";
displayRational( ansNumer, ansDenom );
cout << endl;
return 0;
}
```
You might also like to view...
When entering numbers in a worksheet, the default format is the ________ format
A) General B) Numeric C) Decimal D) Normal
By default, all Impress presentations are password-protected
Indicate whether the statement is true or false
Using good grammar, explain what a Windows shortcut icon represents
What will be an ideal response?
Recently, Frank’s computer has slowed down dramatically. He has also noticed that the time on the computer is not accurate. Frank has run several antivirus scans, but has not found an issue. Today while surfing the web, he was redirected several times to a website that he did not request. Then a BSOD error occurred on his computer, and when he turned on his computer, the antivirus software was disabled. What kind of malware could be causing the issues on Frank’s computer?
A. Zombie B. Rootkit C. Spyware D. Ransomware