memberi dan memberi. Diberdayakan oleh Blogger.
RSS

membuat kotak bolong c++

#include<iostream>
using namespace std;

main()
{int i, j, n;

  cout<<"\t\tFORMASI KOTAK BOLONG"<<"\n";
  cout<<"\t=================================="<<"\n";
  cout<<"\tMasukkan Panjang Kotak :"; cin>>n;
  cout<<"\n";
  i=1;
  while(i<=n)
  {j=1; while(j<=n)
 { if (((i==1)||(i==n))||((j==1)||(j==n)))
   cout<<"*";
  else

    cout<<" ";
  j++;}
  cout<<"\n"; i++;
}}




berikut adalah hasil compilernya :



  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar:

Posting Komentar