Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. typedef struct node{
  5.     int numb;
  6.     struct node *next;
  7.  
  8. }nodeS;
  9.  
  10. int main(){
  11.  
  12.     nodeS *head = NULL;
  13.     nodeS *current = head;
  14.  
  15.     head->next = malloc(sizeof(nodeS));
  16.    
  17.     scanf("%d", &head->numb);
  18.    
  19.     scanf("%d", &head->next->numb);
  20.    
  21.     head->next->next = NULL;
  22.  
  23.     while(current != NULL){
  24.         printf("%d", current->numb);
  25.         current = current->next;
  26.  
  27.     }
  28.  
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement