#include <stdarg.h>doublesum(intcount,...){double total =0; va_list ap;va_start(ap, count);for(int i =0; i < count; i++){ total +=va_arg(ap,double);}va_end(ap);return total;}intmain(){printf("Sum of 1.2, 3.4, and 5.6: %.2f\n", sum(3,1.2,3.4,5.6));}
2. Average of variable arguments
3. Maximum of variable arguments
4. Minimum of variable arguments
5. Printf-like function
6. Error logging with variable arguments
7. Command line argument parsing
8. Callback function with variable number of arguments
9. Function pointer with variable number of arguments
10. Macro with variable number of arguments
11. Passing a variable number of arguments to another function
12. Passing a variable number of arguments to a function pointer