Right angle Star Pattern in C
Output:
enter the number of your choice 5
*
**
***
****
*****
******
Code:
#include<stdio.h>
int main()
{
int i,j,n;
printf("\n enter the number of your choice");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=0;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
Output:
enter the number of your choice 5
*
**
***
****
*****
******
Code:
#include<stdio.h>
int main()
{
int i,j,n;
printf("\n enter the number of your choice");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=0;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
No comments :
Post a Comment