contoh aplikasi array n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Contoh Aplikasi Array PowerPoint Presentation
Download Presentation
Contoh Aplikasi Array

Loading in 2 Seconds...

play fullscreen
1 / 7

Contoh Aplikasi Array - PowerPoint PPT Presentation


  • 138 Views
  • Uploaded on

Contoh Aplikasi Array. Sorting (Bubble Sort). Algoritma Bubble Sort. #include < iostream.h > #include < conio.h > #include < iomanip.h > void main() { int i , j, temp, jumdata ;. Lanjutan. for ( i =0; i <jumdata-1; i ++) for (j=i+1; j< jumdata ; j++) if (data[ i ] > data[j]

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Contoh Aplikasi Array' - cairo-michael


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
contoh aplikasi array

ContohAplikasi Array

Sorting (Bubble Sort)

algoritma bubble sort
Algoritma Bubble Sort

#include < iostream.h>

#include < conio.h>

#include <iomanip.h>

void main()

{

inti, j, temp, jumdata;

lanjutan
Lanjutan

for (i=0; i<jumdata-1; i++)

for (j=i+1; j<jumdata; j++)

if (data[i] > data[j]

{

temp = data[i];

data[i] = data[j];

data[j] = temp;

}

}

contoh 2
Contoh (2)

#include <stdio.h>

void main()

{

inti, j, k, barisA, kolomA, kolomB;

intmatrikA[100][100], matrikB[100][100],

matrikC[100][100];

slide5

printf (“BarisMatriks A = “); scanf (“%d”, &barisA);

printf (“KolomMatriks A = “); scanf (“%d”, &kolomA);

printf (“\n”);

printf (“KolomMatriks B = “); scanf (“%d”, &kolomB);

printf (“\n”);

/* Data Matriks A */

for (i=0; i<barisA; i++)

for (j=0; j<kolomA; j++)

{

printf (“A (%3d, %3d)”, i+1, j+1);

scanf (“%d”, &matrikA[i][j]);

}

printf (“\n”);

}

slide6

/* Data Matriks B */

for (i=0; i<barisA; i++)

for (j=0; j<kolomB; j++)

{

printf (“B (%3d, %3d)”, i+1, j+1);

scanf (“%d”, &matrikB[i][j]);

}

printf (“\n”);

slide7

/* PerkalianMatriks A dan B */

for (i=0; i<barisA; i++)

{

for (k=0; k<kolomB; k++)

{

matrikC [i][k] = 0;

for (j=0; j<kolomA; j++)

matrikC[i][j] +=

matrikA[i][j] * matrikB[j][k];

}

}