ZetaReticuli

mencetakKarakterWhile.c

Sep 15th, 2016
626
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. //fungsi utama
  3. main()
  4. {
  5. //mendeklarasikan variabel awal while
  6.  int i=0;
  7.  //memberi kondisi syarat i<3
  8.  while (i<3)
  9.     {
  10.         //mendeklarasikan variabel awal while yang kedua
  11.         int j=0;
  12.         //memberi kondisi syarat j<=0+i
  13.         while (j<=0+i)
  14.         {
  15.          //mencetak karakter *
  16.           printf("*");
  17.           //melakukan increment bagi while yang kedua
  18.           j++;
  19.         }
  20. //melakukan increment bagi while yang bertama
  21.     i++;
  22. //berganti baris yang baru
  23.     printf("\n");
  24.     }
  25. //menyembunyikan karakter
  26.    getch ();
  27. return (0);
  28. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×