Saturday, 10 October 2015
Bahasa Pemrograman : Struktur Data 03
1. 3 Jenis Perulangan C++
For
Mencetak bilangan 10 sampai 1.
Void cetaklah(int i, int j){
int i=10;
int j=1;
for(i=10;i>=j;i--){
cout<<i;
}
Do...while
Mencetak bilangan 10 sampai 1.
void cetaklah(int i, int j){
int i=10;
int j=1;
do{
cout<<i;
}
while(i>j){
cout<<"Selesai";
}
While
Mencetak bilangan 10 sampai 1.
void cetaklah(int a, int b){
int i=a;
while(i>=b){
cout<<" I = "<<i;
}
2. Array
void masukandata(int A[], int n){
for(int i=0;i<=n;i++){
cout<<"Masukan Data ke"<<i+1;
cin>>A[i];
}
int jumlahkan(const int A[], int n){
int total=0;
for(int=0;i<n;i++){
total += A[i];
return total;
}
Subscribe to:
Post Comments (Atom)
R-chord 謝和弦 - I'm Not Your Prince Charming 我不是白馬王子 Lyrics 歌詞 with Pinyin
R-chord 謝和弦 x 高爾宣 & 李傑明 - I'm Not Your Prince Charming 我不是白馬王子 (Wo Bu Shi Bai Ma Wang Zi) Lyrics 歌詞 with Pinyin | 謝和弦 我不是白馬王子 歌詞 ...
-
Candi Ijo adalah sebuah kompleks percandian bercorak Hindu, berada 4 kilometer arah tenggara dari Candi Ratu Boko atau kita-kira 18 ki...
-
Ngobaran beach is located approximately two kilometers from Ngrenehan beach. At this beach you can see temples, statues, and the beautiful b...
-
He Yi Hang 賀一航 - Please Say Hello First 請先說你好 (Qing Xian Shuo Ni Hao) Lyrics 歌詞 with Pinyin | 賀一航 請先說你好 歌詞 Singer: He Yi Hang 賀一航 Album: Ple...
No comments:
Post a Comment