Created
November 10, 2017 01:47
-
-
Save VirajKanse/1eb0a55b816ce0085528bdbe9c1ef1db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int 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-2); j++) | |
{ | |
printf(" "); | |
} | |
for(j=i; j<=n; j++) | |
{ | |
printf("*"); | |
} | |
printf("\n"); | |
} | |
for(i=1; i<=n; i++) | |
{ | |
for(j=1; j<=i; j++) | |
{ | |
printf("*"); | |
} | |
for(j=(2*i-2); j<(2*n-2); j++) | |
{ | |
printf(" "); | |
} | |
for(j=1; j<=i; j++) | |
{ | |
printf("*"); | |
} | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment