USMI IPB” ILKOM’S GROUP”

Just another WordPress.com weblog

tugas cuy belom selesai…huhuu

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>

struct node{
int data;
struct node*link;
};
struct node *insert(struct node*p, int n)
{
struct node *insert (struct node*p, int n)
{struct node *temp;
if(p=NULL)
p=(struct node*)malloc(sizeof(struct node));
if(p==NULL)
{
printf(“ERROR\n”);
exit(0);
}
p->data=n;
p->link=p;
}
else
{
temp=p;
while(temp->link!=p)
temp=temp->link;
temp->link=(struct node*)malloc(sizeof(struct node));
if(temp->link==NULL)
{
printf(“ERROR\n”);
exit(0);
}
temp=temp->link;
temp->data=n;
temp->link=p;
}
return(p);

}
main()
{
int n, x;
struct node *strat=NULL;
printf(“masukkan jumlah node;”);
scanf(“%d”, &x);
int n, x;
struct node*start=NULL;
printf(“Masukkan isi node:”);
scanf(“%d”, &x);
}
printf(“isi list adalah\n”);
getch();
return 0;
}

Maret 11, 2011 - Posted by | Uncategorized

Belum ada komentar.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: