#include
#include
#define baris 3
#define kolom 4
int main() {
int pil;
menu:
clrscr();
cout<<"Selamat datang di Menu"<
switch(pil) {
case 1:
{
clrscr();
char nama[25];
char kelas[5];
char npm[8];
cout<<"Masukan Nama anda : ";cin>>nama;
cout<<"Masukan Kelas anda : ";cin>>kelas;
cout<<"Masukan NPM anda : ";cin>>npm;
cout<<"\n";
cout<<"Nama anda "<
goto menu;
case 2:
{
clrscr();
int i,j,k;
cout<<"Masukan banyak Looping = ";cin>>k;
for (i=k; i>=1; i--) {
for (j=i; j>=1; j--) {
cout<<"*";
}
cout<<"\n";
}
getch();
goto menu;
case 3:
clrscr();
cout<<"================== Penjumlahan Array =================\n";
cout<<"Ket : Program ini akan menambahkan 2 buah Matriks \n";
cout<<"------------------------------------------------------\n";
int a,b;
int array1[baris][kolom];
int array2[baris][kolom];
int total[baris][kolom];
cout<<"====Penjumlahan Matriks(2,3)==="<
for (b=1; b<4; b++) {
cout<<"Masukan nilai Matriks 1[baris,kolom]"<<"["<cin>>array1[a][b];
} }
cout<
for (b=1; b<4; b++) {
cout<<"Masukan nilai Matriks 2[baris,kolom]"<<"["<cin>>array2[a][b];
} }
cout<
for (b=1; b<4; b++) {
total[a][b]=array1 [a][b]+array2[a][b];
clrscr();
} }
cout<<"Maka hasilnya adalah "<
for (b=1; b<4; b++) {
gotoxy(5,3);cout << total[1][1];
gotoxy(6,3);cout << total[1][2];
gotoxy(7,3);cout << total[1][3];
gotoxy(5,4);cout << total[2][1];
gotoxy(6,4);cout << total[2][2];
gotoxy(7,4);cout << total[2][3];
getch();
}
}
goto menu;
{
case 4:
goto exit;
default:
cout<<"Anda salah menginput data";
exit:
};
return 0;
} } } }
0 komentar:
Posting Komentar