cmonhackns.n-stars.org
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Indonesian SWF Editor Community
 
HomeLatest imagesRegisterLog in
SELAMAT Datang Di Cmonhackns ===> Mulailah dari yang kecil... karena semua yang besar dulunya juga kecil..

 

 Buat Ombak Segitiga dengan While dan For

Go down 
AuthorMessage
RieqyNS13
Moderator
Moderator
RieqyNS13


Jumlah posting : 379
Join date : 2011-01-16
Age : 26
Lokasi : chmod 0655 GetConfig.SQL

Buat Ombak Segitiga dengan While dan For Empty
PostSubject: Buat Ombak Segitiga dengan While dan For   Buat Ombak Segitiga dengan While dan For Icon_minitime1Sat Feb 25, 2012 7:53 pm

Langsung aja ya om,, program console ini untuk menampilkan output berupa segitiga ke arah vertikal dengan secara berulang-ulang sesuai dengan input yang dimasukkan..
ane pke printah While dan For.....
sc :

Code:
//Author : RieqyNS13            //
//E-mail : [You must be registered and logged in to see this link.]//
//--NO COPAS--//////////////////
#include <iostream>
#include <windows.h>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
    system ("color A");
    system ("TITLE Wong Edan");
    int b;
    string v;
    cout<<"Masukkan Jumlah Perulangan = ";
    cin>>b;
    cout<<"Masukkan Nilai Setfill = ";
    cin>>v;
    while(b--)
    {
    for (int a=1; a<=b; a++)
    {
        cout<<setfill('*');
        cout<<setw(a)<<v<<endl;
        Sleep (100);
    }
    int t=b;
    for (int c=1; c<=b; c++)
    {
        t = t-1;
        cout<<setfill('*');
        cout<<setw(t)<<v<<endl;
        Sleep (100);
    }
    }
    system ("pause>nul");
    return 0;
}

Ane compile di Dev-C++ gan,,,
saumpama ane masukin Jumlah Perulangan 13, trus Nilai setfill nya ane masukin R kaya gini :
Code:
R
*R
**R
***R
****R
*****R
******R
*******R
********R
*********R
**********R
***********R
**********R
*********R
********R
*******R
******R
*****R
****R
***R
**R
*R
R
R
R
*R
**R
***R
****R
*****R
******R
*******R
********R
*********R
**********R
*********R
********R
*******R
******R
*****R
****R
***R
**R
*R
R
R
R
*R
**R
***R
****R
*****R
******R
*******R
********R
*********R
********R
*******R
******R
*****R
****R
***R
**R
*R
R
R
R
*R
**R
***R
****R
*****R
******R
*******R
********R
*******R
******R
*****R
****R
***R
**R
*R
R
R
R
*R
**R
***R
****R
*****R
******R
*******R
******R
*****R
****R
***R
**R
*R
R
R
R
*R
**R
***R
****R
*****R
******R
*****R
****R
***R
**R
*R
R
R
R
*R
**R
***R
****R
*****R
****R
***R
**R
*R
R
R
R
*R
**R
***R
****R
***R
**R
*R
R
R
R
*R
**R
***R
**R
*R
R
R
R
*R
**R
*R
R
R
R
*R
R
R
R
R
SS:
[You must be registered and logged in to see this image.]
Walau ane masih smp kelas 2, tpi ane gak copas gan...:bangga:bangga














































[center]
Back to top Go down
http://rieqyns13.net
 
Buat Ombak Segitiga dengan While dan For
Back to top 
Page 1 of 1
 Similar topics
-
» Aplikasi segitiga pascal dengan VB 2010
» Buat Virus Dengan Notepad (Eps.2)
» Buat Virus Dengan Notepad (Eps.1)
» Buat aplikasi Run dengan VB 2010
» Buat Virus Dengan Notepad (Eps.1)

Permissions in this forum:You cannot reply to topics in this forum
cmonhackns.n-stars.org :: Computer Freakz :: All About Programming :: C/C++-
Jump to: