#include <stdio.h>
#include<iostream>
#include <cstdlib>
using namespace std;
int main()
{system ("color b");
int m, n, c, d, matrix[10][10], transpose[10][10];
int menu;
cout<<"\t\t\t Selamat Datang di Program Saya\n";
cout<<"\t ----------Program Transpose Matrik----------\n";
cout<<"\t\n =========== Kelas Teknik Informatika C ===========\n";
cout<<"\t Agri Kuswandani >> 5130411162"<<endl;
printf("Masukan Jumlah Baris dan Kolom ");
scanf("%d%d",&m,&n);
printf("Masukan Elemen Matrik \n");
for( c = 0 ; c < m ; c++ )
{
for( d = 0 ; d < n ; d++ )
{
scanf("%d",&matrix[c][d]);
}
}
for( c = 0 ; c < m ; c++ )
{
for( d = 0 ; d < n ; d++ )
{
transpose[d][c] = matrix[c][d];
}
}
printf("Hasil TRanspose Matrik :-\n");
for( c = 0 ; c < n ; c++ )
{
for( d = 0 ; d < m ; d++ )
{
printf("%d\t",transpose[c][d]);
}
printf("\n");
}
char LG;
cout<<"\n \n Apakah anda ingin mengulang kembali program [ Y/T ] ?";cin>>LG;
if (LG=='Y' || LG=='y')main();
else if (LG=='T' || LG=='t') goto x;
x:
cout<<"Terima Kasih \n";
cout<<"see you";
}
Hasil Compile
Semoga Bermanfaat :)
0 komentar
Posting Komentar