Write a program to print the following pattern.
3
44
55
6666
6666
555
44
3
Answers
Answered by
0
Pattern 3 44 555 6666 6666 555 44 3
Input:
4
Output:
3
44
555
6666
6666
555
44
3
Source code:
#include<stdio.h>
int main()
{
int n,i,j,k,s=3;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(k=1;k<=i;k++)
{
printf("%d",s);
}
s++;
printf("\n");
}
s--;
for(i=n;i>=1;i--)
{
for(k=1;k<=i;k++)
{
printf("%d",s);
}
s--;
printf("\n");
}
return 0;
}
- February 25, 2019
Email This
BlogThis!
Share to Twitter
Share to Facebook
Share to Pinterest
Similar questions