Answer:
The result of the following code will be 9
Explanation:
There are several operators used in Python to do mathematical calculations.
** operator is used for exponents.
i.e.
a ** b mathematically means a^b
Here in the given code
3 is assigned to numA and 2 is assigned to numB
Result will be equal to 3^2
Hence,
The result of the following code will be 9
Answer:
The Harmonium is not a combination of a key board and percussion musical instrument.
Explanation:
The Harmonium is not a combination of a key board and percussion musical instrument.
A harmonium, also called a "melodeon", "reed organ" or "pump organ", is a keyboard instrument that is a lot like an organ. It makes sound by blowing air through reeds, which are tuned to different pitches to make musical notes.
Answer:
#include <iostream>
#include <map>
using namespace std;
int main()
{
map<int, int> numbers;
cout << "Enter numbers, 0 to finish" << endl;
int number;
while (true) {
cin >> number;
if (number == 0) break;
numbers[number]++;
}
for (pair<int, int> element : numbers) {
std::cout << element.first << ": occurs " << element.second << " times" << std::endl;
}
}
Explanation:
One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.
Answer:
BEGIN
INPUT N
IF N>0 AND N<10 THEN
OUTPUT "blue"
ELSE
IF N>10 AND N<20 THEN
OUTPUT "red"
ELSE
IF N>20 AND N<30 THEN
OUTPUT "green"
ELSE
OUTPUT "It is not a correct color option"
ENDIF
END.
Explanation: