the current code can output one circle please complete the code to have multiple circle or draw multiple circle (you don't have to use this code all i want is a multiple circle) do not use graphics please show the output :
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
the current code can output one circle please complete the code to have multiple circle or draw multiple circle (you don't have to use this code all i want is a multiple circle) do not use graphics please show the output :
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout<<"Olympic Rings";
// coordinates
int x,y;
int P;
cout <<"Please enter parameter"<<endl;
cin >>P;
//radius
int r= P/2;
int distance=0;
for(int i=0;i<=P;i++)
{
for (int j=0;j<=P;j++){
x= i-r;
y= j-r;
distance = sqrt((x*x) + (y*y));
if(distance> (r- 0.5)&& distance < (r+0.5))
cout << "*";
else
cout <<" ";
}
cout<<endl;
}
return 0;
}
Step by step
Solved in 3 steps