Answer:
I have Lamborghini Centenario as my profile pic. :)
Explanation:
It stands for arithmetic logic unit
<span>The picture that graphically represents the items you use in windows is called a/an icon.</span>
Answer:
getline(cin, address);
Explanation:
Given
String object: address
Required
Statement that reads the entire line
The list of given options shows that the programming language is c++.
Analysing each option (a) to (e):
a. cin<<address;
The above instruction will read the string object until the first blank space.
Take for instance:
The user supplied "Lagos state" as input, only "Lagos" will be saved in address using this option.
b. cin address:
This is an incorrect syntax
c. getline(cin,address);
Using the same instance as (a) above, this reads the complete line and "Lagos state" will be saved in variable address
d. cin.get(address);
address is created as a string object and the above instruction will only work for character pointers (i.e. char*)
<em>From the above analysis, option (c) is correct.</em>
Question:
Write a function that adds together all values from 0 to a given value and returns the final number. For example, if the given value is `4`, you would add 0 + 1 + 2 + 3 + 4
Answer:
In Python:
def add_to_value(n):
sum = 0
for i in range(n+1):
sum = sum + i
return sum
Explanation:
This line defines the function
def add_to_value(n):
This line initializes sum to 0
sum = 0
The following iteration adds from 0 to n
<em> for i in range(n+1):</em>
<em> sum = sum + i</em>
This line returns the calculated sum
return sum