Write a program to draw the following pattern given.
Attachments:

Anonymous:
Java should be it's base???
Answers
Answered by
2
If u want through java , I have done it, leaving u to the answer , right down in the picture
3:16
don't confuse a =4;
3:16
don't confuse a =4;
Attachments:

Answered by
1
Solution :
Given below is the code :
Output is also given
Code:
#include<iostream>
using namespace std;
int main(){
for(int i=5;i>=1;i--){
for(int k=0;k<(i-1);k++){
cout<<" ";
}
for(int j=5-i+1;j>=1;j--){
if(j==0){
break;
}
cout<<j<<" ";
}
cout<<"\n";
}
}
Hope it helps......
Given below is the code :
Output is also given
Code:
#include<iostream>
using namespace std;
int main(){
for(int i=5;i>=1;i--){
for(int k=0;k<(i-1);k++){
cout<<" ";
}
for(int j=5-i+1;j>=1;j--){
if(j==0){
break;
}
cout<<j<<" ";
}
cout<<"\n";
}
}
Hope it helps......
Attachments:

Similar questions