gambar wajik terbalik koding c++ dan c free












#include <conio.h>
#include <stdio.h>

 main () {
  int a,b,c,d,e,f,g,h,i,j;
  char x,y;
  y='n';

  printf("Masukan berapa tingginya : "); scanf("%d",&a);
  for(f=1;f<=a;f++) {
      for(g=1;g<=f;g++) {
      printf(" ");
      }
      for(h=a-f-1;h>=0;h--) {
      printf("*");
    }
    for(i=f+1;i<a;i++) {
    printf("*");
    }
    printf("\n");
  }
   for(b=1;b<=a;b++) {
      for(c=a-b;c>0;c--) {
      printf (" ");
    }
    for(d=1;d<=b;d++) {
    printf("*");
    }
    for(e=b;e>1;e--) {
    printf("*");
    }
    printf("\n");
  }
  getch();
 }