Function in C Language Questions and Answers

Read tutorials from Function in C Language


Question List:

1. In header files whether functions are declared or defined?

2. Out of fgets() and gets() which function is safe to use and why?

3. Difference between strdup and strcpy?

4. What is recursion?

5. What are static functions? What is their use?

6. What is the difference between actual and formal parameters?

7. Can a program be compiled without main() function?

8. Does a built-in header file contains built-in function definition?

9. what is modular programming.

10. Explain the use of %i format specifier w.r.t scanf().

11. How can you print a (backslash) using any of the printf() family of functions.

12. What are the different ways of passing parameters to the functions? Which to use when?

13. What is a static function?

14. What is the difference between Call by Value and Call by Reference?

15. How do you generate random numbers in C?

16. What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

17. What are actual arguments?

18. What does the function toupper() do?

19. Is it possible to have a function as a parameter in another function?

20. What is the difference between functions getch() and getche()?

21. Can you pass an entire structure to functions?

22. What is gets() function?

23. How do you search data in a data file using random access method?

24. Is there a built-in function in C that can be used for sorting data?

25. What is function prototype?

26. Where should type cast function not be used in C?

27. How many arguments can be passed to a function in C?

28. What is static function in C?

29. If you want to execute C program even after main function is terminated, which function can be used?

30. Is it possible to call atexit() function more than once in a C program?

31. What is exit() function in C?

32. What is the difference between exit() and return() in C?

33. Is there any inbuilt library function in C to remove leading and trailing spaces from a string? How will you remove them in C?

34. What is the use of the function in C?

35. Example of call by value in C Program