Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
METNUM-1-140310120019

# METNUM-1-140310120019

Ratings: (0)|Views: 1 |Likes:
Metoda numerik
Metoda numerik

### Availability:

See more
See less

10/20/2013

pdf

text

original

Muhamad Bayu Perkasa140310120019Tugas Metoda Numerik 11.

#include<stdio.h>2.

#include <conio.h>3.

//
Mendefinisikan fungsi matrikdet

4.

floatmatrikdet(floatp[10][10], intn)
5.

{int i, j;
6.

for(i=0;i<n;i++)  7.

{8.

for(j=0;j<n;j++)  9.

{10.

printf("%.0f\t", p[i][j]);}//
Menampilkan matriks
11.

printf("\n");  12.

}}13.

main()//
Fungsi Utama
14.

{
15.

floatmatriks[10][10],rasio,det;
//Pendeklarasian matrik, rasio dan det

16.

inti,j,k,n;
//Pendeklarasian dari elemen array,dan ordo(n)
17.

printf("----------DETERMINAN MATRIK-----------\n\n");//
Judul Program

18.

//Input data
19.

printf("Masukkan ordo matriks (n x n) : ");scanf("%d",&n);  20.

printf("\nMasukkan elemen Matriks A\n");  21.

for(i=0;i<n;i++)  22.

{23.

for(j=0;j<n;j++)  24.

{printf("Input A[%d][%d] : " ,i+1,j+1);scanf("%f",&matriks[i][j]); 25.

}}26.

27.

printf("\nMatriks A :\n\n");  28.

matrikdet(matriks,n);  29.

for(i=0;i<n;i++){  30.

for(j=0;j<n;j++){  31.

if(j>i){  32.

rasio=matriks[j][i]/matriks[i][i];  33.

for(k=0;k<n;k++){  34.

matriks[j][k] -=rasio*matriks[i][k];  35.

}}}}36.

det=1;  37.

for(i=0;i<n;i++)  38.

det*=matriks[i][i];  39.

printf("\nHasil Determinan matriks A :%.5f\n\n", det);  40.

getch(); 41.

return 0;  42.

}

Tampilan Program