View Code of Problem 53

#include<stdio.h>
int main(){
	int n;
	int t=3;
	scanf("%d",&n);
	for(int i=0;i<=n;i++){
		for(int j=i;j<n;j++){
			printf(" ");
		}
		for(int k=0;k<2*i-1;k++){
			printf("*");
		}
		if(i!=n)
		printf("\n");
	}
	printf("\n");
	for(int a=0;a<n;a++){
		for(int b=0;b<=a;b++){
			printf(" ");
		}
		for(int c=0;c<(2*n-t);c++){
			printf("*");
		}
		t=t+2;
		printf("\n");
	}
}

Double click to view unformatted code.


Back to problem 53