write a java program to print following pattern
1234554321
1234 .....4321
123.......... 321
12 ...............21
1 .....................1
Answers
Answered by
2
Answer:
class brainly
{
public static void main()
{
int i,j;
for(i=1;i>=5;i--)
{
for(j=1;j<=i;j++)
{
System.out.print(j+" "+i);
}
System.out.println();
}
}
}
Answered by
1
Answer:
#include <iostream>
using namespace std;
int main()
{
for(int i=5;i>0;i--)
{
for(int j=1;j<=i;j++)
cout<<j;
for(int l=2*(5-i);l>0;l--)
cout<<".";
for(int k=i;k>0;k--)
cout<<k;
cout<<"\n";
}
return 0;
}
Explanation:
Similar questions