Answer:
are u updating it? or u r rooting it?
Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// function that return greatest common divisor
int g_c_d(int num1, int num2)
{
if (num1 == 0)
return num2;
return g_c_d(num2 % num1, num1);
}
// main function
int main()
{
// variables
int num1,num2;
cout<<"enter two numbers:";
// read two numbers from user
cin>>num1>>num2;
// call the function and print the gcd of both
cout<<"greatest common divisor of "<<num1<<" and "<<num2<<" is "<<g_c_d(num1.num2)<<endl;
}
Explanation:
Read two numbers from user and assign them to variables "num1" and "num2".Call the function g_c_d() with parameter "num1" and "num2".According to Euclidean algorithm, if we subtract smaller number from the larger one the gcd will not change.Keep subtracting the smaller one then we find the gcd of both the numbers.So the function g_c_d() will return the gcd of both the numbers.
Output:
enter two numbers:5 9
greatest common divisor of 5 and 9 is 1
enter two numbers:-25 15
greatest common divisor of -25 and 15 is 5
Answer:
float avg = 23.5;
Explanation:
Given
The declarative statements
Required
Determine which of them is invalid
<em>Analyzing them one after the other;</em>
int zebraCnt = 40000;
This statement is valid as zebraCnt is correctly declared as type integer
<em></em>
long birdCnt = 222_222_222_222_222L;
This statement is valid as birdCnt is correctly declared as type long
float avg = 23.5;
This statement is invalid as avg is incorrectly declared as type float.
<em>To correctly declare avg, you either change the datatype to double: as follows;</em>
double avg = 23.5;
or <em>append f to the declaration; as follows</em>
float avg = 23.5f;
double avg = 98.32121;
This statement is valid as avg is correctly declared as type double
Hence, the incorrect declarative statement is float avg = 23.5;
Answer:
she sells sea shells by the sea shore
Explanation: