answersLogoWhite

0

#include<stdio.h>

#include<string.h>

#include<stdlib.h>

struct node

{

int n;

struct node *ptr;

};

int main(void)

{

struct node *n1,*strt,*temp;

char a;

int cnt=0,i=0;

//char a[50],temp[100],line[100],word[50],e[50],final[100];

//FILE *fp,*fp1,*fp2;

strt=malloc(sizeof(struct node));

strt->n=90;

strt->ptr=NULL;

for(a='y';a!='n';)

{

n1=malloc(sizeof(struct node));

n1->n=++cnt;

n1->ptr=strt;

strt=n1;

scanf("%c",&a);

}

// ptr[1]=40;

// ptr[2]=30;

n1=strt;

while(n1!=NULL)

{ printf("\n %d at loc %p",n1->n,n1);

printf(" locaa %p \n",n1->ptr);

n1=n1->ptr;

}

return 0;

}

~

~

~

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a program in C to create a Circular Linked list?

#include&lt;iostream.h&gt;


How to write aC program to merge two singly linked list?

write a c program to circular queue


C program to implement deque using circular linked list?

You'll need to use a doubly-linked circular list, since otherwise when you pop off the tail element you'll need to whizz all the way round the list to find its predecessor. See the links section for an implementation of a doubly-linked circular list.


What is meant by doubly linked list?

In C programming, a double linked-list refers to a linked data structure that contains a set of links that have been linked sequentially.


Consider a linked list with n integers Each node of the list is numbered from 1 to n Develop a program using C language to split this list into 4 lists so that.?

list any six consteations


Write a Linked list program for insertion and deletion of a node using structureswitch case and in c language?

for all datastructure ,c,c++ programs just visit codingdatastructure.blogspot.com and found on blog archive..


32 can you create a linked list with out structure pointer?

Not in C, no.


Write a algorithm for doubly linked list in c?

sorry


What is linked list in C langauage?

A linked list is a collection of items, often nodes, that are sequentially linked by some kind of index or pointer contained within each item.


Which of the following data structures can be randomly accessed giving loc A. linked list implemented using array B. singly linked list C. double linked list D. both single and double linked list?

Which of the following data structures can be randomly accessed giving loc?A. linked list implemented using arrayB. singly linked listC. double linked listD. both single and double linked listThe answer is A.


Is there a c program to multiply two polynomials using linked lists?

yes


What does the word 'node' mean in c plus plus?

A node is an object in some kind of linked structure, such as a linked list or tree. Nodes can be allocated off of the free list and added to the linked list or tree at hand, and then filled in with the data needed to represent some piece of information. Conversely, they can be unlinked from the linked list or tree, and then returned to the free list when they are no longer needed. Often, there is no direct variable of pointer in the program's scope that represents the node; rather, the node can be found by traversing a list of linkages, list or tree, in the applicable data structure. There are other definitions of "node", but this is the most common.