mhdew

Sum

Mar 3rd, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. void sum()
  2. {
  3.     node *pointer=head;
  4.     int sum=0;
  5.     while(pointer!=NULL){
  6.         sum+=pointer->data;
  7.         pointer=pointer->next;
  8.     }
  9.     printf("%d\n", sum);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment