Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- typedef struct node{
- int value;
- struct node *next;
- }NODE;
- void main(){
- NODE *head=NULL;
- int i,x=3;
- struct node *t;
- head=(NODE*) malloc (sizeof(NODE));
- head->value=x;
- t=head;
- for(i=1;i<50;i++){
- t->next=(NODE*) malloc (sizeof(NODE));
- t=t->next;
- t->value=x;
- t->next=NULL;
- x+=2;
- }
- for(t=head; t!=NULL ; t=t->next){
- printf("%d ->",t->value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement