Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- typedef struct Node
- {
- double x;
- char y;
- struct Node*next;
- }node;
- int main()
- {
- node*head=(node*)malloc(sizeof(node));
- head->y='A';
- head->x=7.99;
- head->next=(node*)malloc(sizeof(node));
- head->next->y='Z';
- head->next->x=2.05;
- head->next->next=(node*)malloc(sizeof(node));
- head->next->next->y='X';
- head->next->next->x=3.67;
- head->next->next->next=NULL;
- node*current=head;
- while(current!=NULL)
- {
- printf("%c %lf\n", current->y,current->x);
- current=current->next;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement