Write a program to print the following pattern using loop in language.
#include<studio.h>
#include<coino.h>
Void main()
{
Int
I,j,n,k;
Printf(“Enter
Your no : ”);
Scanf(“%d”,&n);
For(i=1;i<n;i++)
{
For(j=1;j<=I;j++)
{
Printf(“ “);
}
For(k=n;k>=I;k--)
{
Printf(“*”);
Printf(“
“);
}
Printf(“\n”);
}
}
output :-
* * * * * *
* *
* * *
* * * *
* * *
* *
*
No comments
Post a Comment