0
Plz tell me a program to display the following pattern.
1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
2 Answers
+ 3
#include <iostream>
using namespace std;
int main() {
for(int i=0;i<5;i++){
int x=1;
for(int j=0;j<5;j++) {
if(j<i){
cout <<" ";
}else{
cout <<x++<<" ";
}
}
cout<<endl;
}
return 0;
}
+ 1
Code::Blocks