Computer Science, asked by AliAbbas11, 1 year ago

how to print pattern
55555
4444
333
22
1

Answers

Answered by siddhartharao77
2
#include<stdio.h>
void main()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}

AliAbbas11: what is %d
siddhartharao77: format specifier
Answered by Anonymous
41



ANSWER
........








import java.io.*;

public class loopp
{
public static void main(String args[])
{
int a,b;
for (a=5;a>=1;a--)
{
for(b=1;b<=a;b++)

{
System.out.print(a);
}
System.out.println();
}
}
}
Similar questions