google-site-verification=C_rXmwzhIbKm7ffq5MkVWFUQam5H0kk2mgHJLuASTQw

Rabu, 04 Maret 2015

membuat formasi bintang menggunakan bahasa pemograman c++

#include <iostream.h>
#include <conio.h>

int main()
{
  int n, i, j;
  clrscr();

  cout<<"Inputkan Jumlah: ";
  cin>>n;

  for (i=1; i<=n; i++)
  {
 for (j=n; j>i; j--)
 {
 cout<<" ";
  }

  for (int k=1; k<=i; k++)
  {
 cout<<" *";
 }
 cout<<"\n";
  }
  getch();
}

0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Hostgator Discount Code