graph
Sat Oct 21 2023 21:28:27 GMT+0000 (Coordinated Universal Time)
Saved by
@yolobotoffender
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int x,n,y,hor_s;
cout<<"value of x: ";
cin>>x;
cout<<"input vlue of n: ";
cin>>n;
//equation of y is:
y = pow(x, n) + pow(x,n-1);
for(y;y>= 0;y -= 2){
if(y == pow(x,n) + pow(x,n-1)){
for (int s=1;s<=(x*2)+1;s++){
cout<<' ';
}
cout<<'*';
x--;
}
else
{
cout<<' ';
}
cout<<endl;
}
y = pow(hor_s,n) + pow(hor_s,n-1);
for(int i=0;i<=hor_s;i++){
if(i==0){cout<<" "<<i;}
else if(i>=1 && i<=9){cout<<' '<<i;}
else if(i>=10 && i<=99){cout<<" "<<i;}
}
return 0;
}
content_copyCOPY
Comments