Answer:
it can be anything from attachments/images or links
Explanation:
Answer:
#include <iostream>
using namespace std;
void miles_to_km(float &miles)//function to convert miles to kilo meters.
{
miles=miles*1.6;
}
int main() {
float miles;
cout<<"Enter the miles"<<endl;
cin>>miles;//taking input of the miles..
miles_to_km(miles);//calling function that converts miles to km..
cout<<"The number of km is "<<miles<<endl;//printing the km.
return 0;
}
Output:-
Enter the miles
54
The number of km is 86.4
Explanation:
I have created a function miles_to_km of type void which has the argument miles passed by reference.In the function the variable miles is converted to kilo meters.Then in the main function the function is called with the value prompted from the user.Then printing the changed value.
Answer:
This is an Ethernet port operating at half duplex.
Explanation:
Modern Ethernet networks built with switches and full-duplex connections no longer utilize CSMA/CD. CSMA/CD is only used in obsolete shared media Ethernet (which uses repeater or hub).
Answer:
# The count variable should be defined in a global scope.
count = 0
def count_users(group):
for member in get_members(group):
count += 1
if is_group(member):
count += count_users(member)
return count
print(count_users("sales")) # Should be 3
print(count_users("engineering")) # Should be 8
print(count_users("everyone")) # Should be 18
Explanation:
The count variable should be defined in a global scope which means that it shouldn't be defined inside the scope of the count_users function.
The reason is that count_users is a recursive function and when it is called recursively then it will be setting the count variable to 0 again and again, hence instead of keeping the count of users, it will lose the value all the time serving no purpose. But when it's defined outside the function then it will not initialized again in the recursive calls.