Not getting a right output
Pattern triangle
In this ques you just need to take a input n from user then create this triangle with the help of loops.
If you need i can write code for you but first give it a try.
Can you make corrections in the code
#include
using namespace std;
int main() {
int n;
//int num=1;
cin>>n;
for(int i=1;i<=n;i++)
{
for(int space=i;space<=n-1;space++)
{
cout<<"\t";
}
int j;
for(j=i;j<=2*i-1;j++){
cout<<j<<"\t";
}
jβ;
for(;j>i;jβ){
cout<<j-1<<"\t";
}
cout<<endl;
}
return 0;
}
Not showing any output. pls check
Itβs the same code above. This will work because in above code during copy/paste something might have gone wrong.
1 Like