+ 1
i want to show this output ***** **** *** ** * * ** *** **** *****
how is this
3 Answers
+ 7
int main() {
int n=5;
// cin>>n;
for(int i=0;i<n;i++){
for(int j=n;j>i;j--){
cout<<"*";
}
cout<<"\n";
}
for(int i=0;i<n;i++){
for(int j=0;j<=i;j++){
cout<<"*";
}
cout<<"\n";
}
return 0;
}
+ 3
#include <iostream>
using namespace std;
int main()
{
for (int i = 1; i <= 5; i++) {
for (int j = i; j <= 5; j++) {
cout << "*";
}
cout << endl;
}
//â-------------------
for (int i =1; i <= 5; i++){
for (int j = 1; j <= i; j++) {
cout << "*";
}
cout << endl;
}
return 0;
}
0
Can you teach me..?