/* Note: Tested with TurboC++ compiler ONLY */ /* Compute the sum of values in the variable argument list */ #include #include int Sum(int a,...) { int total=a; va_list ap; int arg; va_start(ap,a); while ((arg = va_arg(ap,int)) != 0) { total+=arg; } va_end(ap); return total; } void main() { clrscr(); printf("%d",Sum(5,6,7,8,9,10)); getch(); } /* End of main */