I've fixed the problem in linked list ' program ..
and it's working now ..
#include<stdio.h>
#include<stdlib.h>
struct nodetype
{
int info;
struct nodetype* previous;
struct nodetype* next;
}*ptree ,*p ,*q;
struct nodetype * MakeNode(struct nodetype * p ,int x)
{
q = (struct nodetype *)malloc (sizeof (struct nodetype));
q->previous = p;
q->info = x;
q->next = NULL ;
return(q);
}
void PrintTreed (struct nodetype* tree)
{
if (tree!=NULL)
{
printf("%d", tree->info);
printf(" ");
PrintTreed( tree->next);
}
else
printf(".");
}
void PrintTreeu (struct nodetype* tree)
{
if (tree!=NULL)
{
printf("%d", tree->info);
printf(" ");
PrintTreeu(tree->previous);
}
else
printf(".");
}
int main()
{
ptree =(struct nodetype *)malloc (sizeof (struct nodetype));
p = (struct nodetype *)malloc (sizeof (struct nodetype));
int number;
scanf("%d", &number);
p = NULL ;
ptree = MakeNode(p,number);
p = ptree;
while(scanf("%d", &number), number!=0)
{
p->next = MakeNode(p,number);
p = p->next;
}
PrintTreed(ptree);
printf("\n");
PrintTreeu(p);
printf("\n");
return (0) ;
}