Code:
 


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

typedef struct linkedlist {
        int data;
        struct linkedlist *next;
        }newnode;

void insert(newnode **,int);

void show(newnode *);



int main(int argc, char *argv[])
{
newnode *list1s=NULL;
newnode *list2s=NULL;
int list1,list2;
printf("Enter the integer for first list...");
                 scanf("%d",&list1);
                 if(list1!=0) insert(&list1s,list1);
                 printf("Enter the integer for second list...");
                 scanf("%d",&list2);
                  if(list2!=0) insert(&list2s,list2); 

  while(list1!=0 || list2!=0) {
                 if(list1==0) {
                               printf("Enter the integer for second list...");
                 scanf("%d",&list2);
                  if(list2!=0) insert(&list2s,list2);  }
                              if(list2==0) {
                  
                              printf("Enter the integer for first list...");
                 scanf("%d",&list1);
                  if(list1!=0) insert(&list1s,list1); }
                
                 }
show(list1s); printf("\n");
show(list2s); 
  system("PAUSE");	
  return 0;
}

void insert(newnode **sptr,int value) {
   newnode *previous,*newptr,*current;
   if((newptr=malloc(sizeof(newnode)))!=NULL) {
       newptr->data=value;
       newptr->next=NULL;
       previous=NULL;
       current=*sptr;
       while(current!=NULL && value> current->data) {
                           previous=current;
                           current=current->next; }
                           if(previous==NULL) {
                                              newptr->next=*sptr;
                                              *sptr=newptr; }
                                              else {
                                                   newptr->next=current;
                                                   previous->next=newptr; }
                                                   }
                                                   else { printf("there is no available memory"); }
                                                   }
                                                   
void show(newnode *sptr) {
     if(sptr!=NULL) {
        printf("%d---->",sptr->data);
       sptr=sptr->next;
while(sptr!=NULL) {
                           printf("%d---->",sptr->data);                                                 
        sptr=sptr->next;
 }                                                                                                                                                                            }
printf("NULL");
}
I think the code was intended properly. If not please warn me. The problem here is I am trying to enter numbers to two different linkedlist one by one. Out put.

Enter the first list's number ......
Enter the second...
Enter the first list...
Enter the second..... (Not exact output but the aim's the same)

What I want to do , if I enter 0 for one , it will never want me to enter an integer for that list again , and want me to enter integers for the other one until I enter 0 for that too. The related part of the code is here:

Code:
#include <stdlib.h>

typedef struct linkedlist {
        int data;
        struct linkedlist *next;
        }newnode;

void insert(newnode **,int);

void show(newnode *);



int main(int argc, char *argv[])
{
newnode *list1s=NULL;
newnode *list2s=NULL;
int list1,list2;
printf("Enter the integer for first list...");
                 scanf("%d",&list1);
                 if(list1!=0) insert(&list1s,list1);
                 printf("Enter the integer for second list...");
                 scanf("%d",&list2);
                  if(list2!=0) insert(&list2s,list2); 

  while(list1!=0 || list2!=0) {
                 if(list1==0) {
                               printf("Enter the integer for second list...");
                 scanf("%d",&list2);
                  if(list2!=0) insert(&list2s,list2);  }
                              if(list2==0) {
                                   printf("Enter the integer for first list...");
                                      scanf("%d",&list1);
                                 if(list1!=0) insert(&list1s,list1); }
                
                 }
What is the problem. It's been 3 days since I have stopped to think. I couldnt give enough time before too. So I am not really used to this piece of code . But yet , I want to solve this.Thank you for all responses.