NAME-mayank
ROLLNO.1324595
PROGRAM NO.07
6] Write a program to print the each of the following patterns.
1] ALGORITHM-
Step1) start
Step2) take integer n
Step3) loop outer and inner to print numbers
Step4) print the number
Step5) stop
2] flow chart-
START
INPUT number of rows
(n )
Initialize i=1
Apply the conditions
Increment or decrement
end
3) SOURCE CODE- #include<stdio.h> int main()
{ int i,j,row; printf("Enter number of rows:
scanf("%d",&row); for(i=1;i<=row;i++)
for(j=1;j<=row-i;j++) { printf("
");
for(j=1;j<=i;j++) { printf("%d",
j);
} for(j=i-1;j>=1;j--)
{ printf("%d", j);
printf("\n");
return 0;
4) OUTPUT-