Showing posts with label segitiga bintang. Show all posts
Showing posts with label segitiga bintang. Show all posts

Thursday, May 19, 2016

SEGITIGA BINTANG C++ LAGI :D

Oke langsung saja, berikut source codenya: :)

#include <iostream>

using namespace std;

main()
{



int a,b;
char x ='*';
for (a=1; a<=4; a++)
{

    for ( b=1; b <=a; b++)

    cout <<x;
    cout<<endl;

}
}

dan hasilnya :)

CARA MEMBUAT SEGITIGA BINTANG C++

Assalamu'alaikum Wr. Wb.
Oke, di sini saya akan berbagi cara membuat segitiga bintang seperti piramida tetapi terbalik menggunakan C++
di sini sya menggunakan CODE::BLOCK, berikut source code-nya :)

#include <iostream>

using namespace std;

main()
{



int a,b;
char s ='*';
for (a=4; a>=1; a--)
{

    for ( b=1; b <=a; b++)

    cout <<s;
    cout<<endl;

}
}

dan berikut hasil nya :)

Taraaa !!! :D :D