Powered by Blogger.

Print Star Patter in C



Print Star Patter in C

Print Star Pattern in C It is very simple just we need concept of new line and for loop.

Print Star Patter

    *
   ***
  *****
 *******
*********

Example to Print Star Pat 

#include <stdio.h>
#include <conio.h>
void main()
{
int i, j, n;
printf("Enter value of n : ");
scanf("%d", &n);
for(i=1; i<=n; i++)
{
for(j=i; j<n; j++)
{
printf(" ");
}
for(j=1; j<=(2*i-1); j++)
{
printf("*");
}
printf("\n");
}
getch();
}



facebook
google-plus
twitter
pinterest

No comments :

Post a Comment

HTML Tutorial

images

About Sitesbay

This blog is related to Java Tutorial, C++ Tutorial, C Tutorial, Online Earning tips and more in very simple and easy way. Here i will try to give complete idea related to all new technology.

Java Tutorial

Java is Object oriented programming language, It is more secure and high performance language.

C++ Tutorial

C++ is also Object oriented programming language, It is more simple and easy to learn.

 
https://sitesbay.blogspot.com/?utm_medium=d2898efa59afcc0bc411921036e22b767ca37b09