Sampurasun........
Hai gan, kali ini saya sharing tugas kuliah tentang program matrik transpose.... silahkan di simak gan... jika berguna monggo copy.... sok lajeungkeun.............................
#include<stdio.h>
#include<conio.h>
#include <iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
int main()
{
cout<<"\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;
int A[10][10],baris,kolom,i,k;
printf("\nMasukkan jumlah baris: ");
scanf("%d",&baris);
printf("Masukkan jumlah kolom: ");
scanf("%d",&kolom);
//input data matriks
for(i=0;i<baris;i++)
{
for(k=0;k<kolom;k++)
{
printf("Data A[%d][%d]: ",i,k);
scanf("%d",&A[i][k]);
}
printf("\n");
}
//cetak data matriks A
printf("\nMatriks A: \n");
for(i=0;i<baris;i++)
{
for(k=0;k<kolom;k++)
printf("%d\t",A[i][k]);
printf("\n");
}
//cetak data matriks A tranpose
printf("\nMatriks A transpose: \n");
for(k=0;k<kolom;k++)
{
for(i=0;i<baris;i++)
printf("%d\t",A[i][k]);
printf("\n");
}
//cetak data matriks A tranpose x matrix A
printf("\nPerkalian Matriks A dengan Matriks A transpose: \n");
for(k=0;k<kolom;k++)
{
for (i=1;i<=2;i++)
for (k=1;k<=2;k++){
printf("%d\t",A[i][k]);
printf("\n");
}
getch();
}
}
Hasil Compile Program
0 komentar
Posting Komentar