0% found this document useful (0 votes)
20 views2 pages

Dojdj

Hehhs

Uploaded by

hendrisaputra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Dojdj

Hehhs

Uploaded by

hendrisaputra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

2.

#include <stdio.h>

#include <stdlib.h>

typedef struct nasabah{

int kode;

char nama[20],alamat[10],kota[10],no[20];

} bank;

bank nasabah[50];

int main(){

int n;

printf("Masukkan Data Nasabah : "); scanf("%d", &n);

int i;

int j;

for( i=1;i<=n;i++){

printf("\nData ke-%d :\n", i);

printf("Account\t\t: "); scanf("%d", &nasabah[i].kode);

printf("Nama\t\t: "); scanf("%s", nasabah[i].nama);

printf("Alamat\t: "); scanf("%s", nasabah[i].alamat);

printf("Kota\t\t: "); scanf("%s", &nasabah[i].kota);

printf("No.Telp\t\t: "); scanf("%s", &nasabah[i].no);

for(i=1;i<=n;i++){

for( j=1;j<=n;j++){

if (nasabah[i].kode < nasabah[j].kode){

int bantu = nasabah[i].kode;

nasabah[i].kode = nasabah[j].kode;

nasabah[j].kode = bantu;

}
printf("\n-----------------------------------------Urut Kode-----------------------------------------\n");

printf("----------------------------------------------------------------------------------");

printf("\n|Account\t|\tNama\t|\tAlamat\t|\tKota\t|\tNo.Telp\t|\n");

printf("----------------------------------------------------------------------------------");

for( i=1;i<=n;i++){

printf("\n|%d\t|\t%s\t|\t%s\t\t|\t%s\t|%s\t",
nasabah[i].kode,nasabah[i].nama,nasabah[i].alamat,nasabah[i].kota,nasabah[i].no);

printf("\n--------------------------------------------------------------------------------");

printf("\n");

return 0;

Type Nasabah : Record

< Nomor_Acount : Integer , (20)

Nama_Nasabah : Char , (20)

Alamat_Nasabah : Char , (10)

Kota_Nasabah : Char , (10)

Nomor_telepon : Char ,(10) >

You might also like