Practice Top 30 C Programming Questions on Variadic Function
Q1. Write a variadic function to calculate the sum of N numbers.
Input: 5, 1, 2, 3, 4, 5
Output: Sum = 15
Q2. Write a variadic function to find the maximum among N numbers.
Input: 4, 12, 9, 15, 3
Output: Maximum = 15
Q3. Write a variadic function to concatenate multiple strings.
Input: "Hello", " ", "World!"
Output: Hello World!
Q4. Write a variadic function to find the minimum among N numbers.
Input: 4, 5, 3, 9, 1
Output: Minimum = 1
Q5. Write a variadic function to calculate the average of N numbers.
Input: 3, 10, 20, 30
Output: Average = 20
Q6. Write a variadic function to print all its arguments.
Input: 4, 1, 2, 3, 4
Output: 1 2 3 4
Q7. Write a variadic function to calculate the sum of only positive numbers.
Input: 5, -3, 7, 4, -1, 2
Output: Sum = 13
Q8. Write a variadic function to calculate the length of multiple strings.
Input: "C", "Programming", "Language"
Output: 1 11 8
Q9. Write a variadic function to count how many numbers are odd.
Input: 6, 4, 5, 7, 10, 13, 6
Output: Odd Count = 3
Q10. Write a variadic function to calculate the product of N numbers.
Input: 3, 2, 3, 4
Output: Product = 24
Q11. Write a variadic function to check if all numbers are even.
Input: 4, 2, 4, 6, 8
Output: All Even = Yes
Q12. Write a variadic function to print multiple strings.
Input: "I", "Love", "C"
Output: I Love C
Q13. Write a variadic function to find the largest string by length.
Input: "C", "Python", "JavaScript"
Output: Largest = JavaScript
Q14. Write a variadic function to count the total number of arguments.
Input: 5, 10, 20, 30, 40, 50
Output: Count = 5
Q15. Write a variadic function to find the smallest string by length.
Input: "Hello", "Hi", "Hey"
Output: Smallest = Hi
Q16. Write a variadic function to check if given strings are palindromes.
Input: "madam", "hello", "civic"
Output: Yes No Yes
Q17. Write a variadic function to concatenate strings with a given delimiter.
Input: ",", "Red", "Green", "Blue"
Output: Red,Green,Blue
Q18. Write a variadic function to print all arguments in reverse order.
Input: 3, 1, 2, 3
Output: 3 2 1
Q19. Write a variadic function to check if all strings start with a specific character.
Input: 'H', "Hello", "Hi", "Hey"
Output: Yes
Q20. Write a variadic function to calculate the sum of squares of N numbers.
Input: 3, 2, 3, 4
Output: Sum of Squares = 29
Q21. Write a variadic function to find the longest word in a sentence.
Input: "I love programming in C"
Output: Longest = programming
Q22. Write a variadic function to check if all numbers are positive.
Input: 4, 1, 2, 3, 4
Output: All Positive = Yes
Q23. Write a variadic function to compare two lists and check if they are identical.
Input: 3, 1, 2, 3 and 3, 1, 2, 3
Output: Identical = Yes
Q24. Write a variadic function to count the number of even and odd numbers.
Input: 5, 1, 2, 3, 4, 5
Output: Even = 2, Odd = 3
Q25. Write a variadic function to calculate the sum of digits of multiple numbers.
Input: 2, 123, 456
Output: 6 15
Q26. Write a variadic function to find the shortest word in a sentence.
Input: "I love coding"
Output: Shortest = I
Q27. Write a variadic function to check if all numbers are divisible by a given number \( K \).
Input: 3, 2, 4, 6
Output: Divisible by 2 = Yes
Q28. Write a variadic function to multiply only positive numbers.
Input: 5, -2, 3, 4, -1, 2
Output: Product = 24
Q29. Write a variadic function to convert multiple strings to uppercase.
Input: "hello", "world"
Output: HELLO WORLD
Q30. Write a variadic function to find all words in a sentence with a specific length.
Input: "C programming is fun", 2
Output: is
Bikki Singh
Hi, I am the instructor of TechnoVlogs. I have a strong love for programming and enjoy teaching through practical examples. I made this site to help people improve their coding skills by solving real-world problems. With years of experience, my goal is to make learning programming easy and fun for everyone. Let's learn and grow together!