Answer:
Explanation:
For to stablish with more power his new empire based on christianity.
Answer:
#include <iostream>
using namespace std;
void swap(int& m, int& n) /* passing by reference so that changes will be made in the original values.*/
{
int t=m;
m=n;
n=t;
}
int main()
{
int val1,val2;
cout<<"Enter the values"<<endl;
cin>>val1>>val2;
cout<<"Values before swap "<<val1<<" "<<val2<<endl;
swap(val1,val2);
//calling the function swap..
cout<<"Values after swap "<<val1<<" "<<val2<<endl;
return 0;
}
Explanation:
Created a function swap with 2 arguments m and n passed by reference.
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
Yes ok I get your questions
Answer: False
Explanation: In c++ a repetition statement continues looping until the relational expression in the statement evaluates to false.