Advertisement
Dprogrammed1

C ques 18

Apr 5th, 2019
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdarg.h>
  3. void dumplist(int, ...);
  4.  
  5. int main()
  6. {
  7. dumplist(2, 4, 8);
  8. dumplist(3, 6, 9, 7);
  9. return 0;
  10. }
  11. void dumplist(int n, ...)
  12. {
  13. va_list p; int i;
  14. va_start(p, n);
  15.  
  16. while(n-->0)
  17. {
  18. i = va_arg(p, int);
  19. printf("%d", i);
  20. }
  21. va_end(p);
  22. printf("\n");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement