Print the following pattern in java
12345
1234
123
12
1
Share
Print the following pattern in java
12345
1234
123
12
1
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Explanation:#include <stdio.h>
#include<conio.h>
void main()
{
int i, j;
for(i=5;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
}
Output:
12345
1234
123
12
1