PROGRAM DASAR ( MENGCOUT KATA)
Deklarasi:
- Kata: integer
- Char kata [5][2][15]
- for (int baris =0;baris<5;baris++)
- if kata[baris][0][0]=='I')
Outputnya: kata
#include <iostream>
#include <string.h>
int main(int argc, char *argv[])
{
char kata[5][2][15] ={{"UAD","YOGYAKARTA"},
{"pilhipina","manila"},{"Australia","Wina"},
{"JAWA","INDONESIA"},{"ALGO","JELIOT"}};
for (int baris =0;baris<5;baris++){
if (kata[baris][0][0]=='I')
cout<<kata[baris][0]<<"-"<<kata[baris][1]<<"\n";
}
return 0;
}
Tidak ada komentar:
Posting Komentar