5432*
543*1
54*21
5*321
*4321
#include<stdio.h>
int main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=5;j>=1;j--)
{
if(i==j)
printf("*");
else
printf("%d",j);
}
printf("\n");
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
Hello,
ReplyDeleteyou have missed the later part i.e. printing after *.
Below code is correct one.
#include
int main()
{
int i, j;
int n;
printf("Enter a number : ");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
for (j = n; j >= i; j--)
{
if (j == i)
printf("*");
else
printf("%d", j);
}
for (; j >= 1; j--)
{
printf("%d", j);
}
printf("\n");
}
return 0;
}
#include
ReplyDeleteint main()
{
int r,i,j,s,k;
printf("Enter the no. of rows : ");
scanf("%d",&r);
for(i=1;i<=r;i++)
{
for(j=r;j>=1;j--)
{
if(j==i)
{
printf("*");
}
else
{
printf("%d",j);
}
}
printf("\n");
}
}
can you please tell the same codes in python!!!
Deleten=int(input())
Deletefor i in range(n,0,-1):
j=n
k=1
while(j):
if(k==i):
print('*',end='')
k+=1
j-=1
else:
print(j,end='')
k+=1
j-=1
print()
correct
DeleteCan you do this pattern?
ReplyDelete*4321
5*321
54*21
543*1
5432*
Wsumptiatempse Sarah Smith https://marketplace.visualstudio.com/items?itemName=poeglosungu.Descargar-Deep-Despair-gratuita-2022
ReplyDeletepaifurnailen
sconmiter-wo David Reyes link
ReplyDeleteclick here
click here
download
nosychbacktes
VgraphturXumro Jimmy Bowman Check it
ReplyDeleteclick
Best
precchamaklink