Featured

PasangIklanoketrik PasangIklanoketrik PasangIklanoketrik PasangIklanoketrik PasangIklanoketrik

14 Desember 2011

contoh fungsi tingkat 1

#include <iostream>
#include <conio.h>
using namespace std;

void cetak(char karakter, int jumlah)
{for (int a=1; a<=jumlah; a++) {
    cout<<karakter;}

}
void segitiga(int jml)
{   for (int b=1; b<=jml; b++) {
        cetak(' ',(10-b));
        cetak('^',(2*b-1));
        cout<<endl;
    }
}
void sget(int jml)
{   for (int c=5; c>=jml; c--) {
        cetak(' ',(10-c));
        cetak('v',(2*c-1));
        cout<<endl;
    }
}
void garis(int jml)
{   for (int d=6; d<=jml; d++) {
        cetak(' ',(10-d));
        cetak('-',(2*d-1));
        cout<<endl;
    }
}
int main()
{
    segitiga(5);
    garis(6);
    sget(1);
   

    _getch();
    return 0;
}
pasangiklanoketrik pasangiklanoketrik pasangiklanoketrik pasangiklanoketrik pasangiklanoketrik
 
© linesite cheater | Design by Blog template in collaboration with Concert Tickets, and Menopause symptoms
Powered by Blogger
PasangIklanoketrik PasangIklanoketrik PasangIklanoketrik PasangIklanoketrik PasangIklanoketrik