Program Menghitung Segitiga
Jul 12, 2009 2 Comments
#include
int main()
{
int jumlah;
cout < < "BERAPA TINGGI SEGITIGA = ";
cin >> jumlah;
for (int i=1; i<= jumlah;i++) { for(int j=1; j<=i; j++) { cout<< "*"; } cout<< "\n"; } return 0 ; }
#include
int main()
{
int jumlah;
cout < < "BERAPA TINGGI SEGITIGA = ";
cin >> jumlah;
for (int i=1; i<= jumlah;i++) { for(int j=1; j<=i; j++) { cout<< "*"; } cout<< "\n"; } return 0 ; }
You must be logged in to post a comment.
Contoh program :
10+8+6+4+2 =30
10+8+6+4 =28
10+8+6 =24
10+8 =18
10 =10
mas tlong buatin program yang hasil cetaknya seperti di atas…..
please………….
syntax nya beda banget ma Visual basic ya