Write a program to print the following pattern using loop in c language.
#include<stdio.h>
#include<conio.h>
Void main()
{
Int I,j,n,k=1;
Printf(“Enter Your no:”);
Scanf(“%d”,&n);
For(i=1;i<n;i++)
{
For(j=1;j<I;j++)
{
Printf(%d”,j);
Printf(“
”);
J++;
}
Printf(“\n”);
}
}
Output :-
1
2 3
3 4 5
4 5 6
7
5 6 7
8 9
No comments
Post a Comment