C Programming

There are Multiple Choice Questions

Correct answers color: Green

Wrong answers color: Red

 
START LEARNING

#1. Who is the father of C Programming Language?

#2. What is the file extension for C programs?

#3. Which keyword is used to declare a variable in C?

#4. Which function is used to print output in C?

#5. Which library is included to use standard I/O functions like printf() ?

#6. What is the size of an int data type in C?

#7. What does the ‘%’ operator do in C?

#8. What is the format specifier for a float in C

#9. Which data type can store a single character in C?

#10. What will be the result of 5 / 2 in C if both are integers?

#11. Which keyword is used to exit a loop prematurely?

#12. What is the output of the following code snippet? int x = 5; if (x > 0) printf(“Positive”); else printf(“Negative”);

#13. Which loop executes at least once, even if the condition is false?

#14. Which control structure is used to handle multiple conditions?

#15. What is the output of this code? for (int i = 0; i < 3; i++) { printf(“%d “, i); }

#16. What is the correct syntax to declare a function in C?

#17. What is the index of the first element in an array?

#18. How do you access the 3rd element of an array in C?

#19. Which function is used to find the length of a string in C?

#20. Which header file is required for using string functions like strcmp()?

#21. What does a pointer variable store?

#22. Which operator is used to get the address of a variable in C?

#23. What is the output of this code snippet? int x = 10, *p; p = &x; printf(“%d”, *p);

#24. What is a NULL pointer in C?

#25. Which of the following correctly declares a pointer?

#26. Which keyword is used to define a structure in C?

#27. What is the correct syntax to access a structure member using a pointer?

#28. What is the size of an empty structure in C?

#29. Which of these allows defining a structure inside another structure?

#30. How are structure members accessed in C?

#31. Which function is used to dynamically allocate memory in C?

#32. What happens if free() is not used after malloc()?

#33. What is the purpose of calloc()?

#34. What is the syntax for realloc()? (realloc()

#35. What happens when you free() memory twice?

#36. Which function is used to open a file in C?

#37. What does the mode “r” signify in fopen()?

#38. Which function is used to read a character from a file?

#39. Which library provides file handling functions

#40. Which function is used to close a file?

Previous
Finish

Results

Congratulations !

Opps! Try Again

 

For More Information Visit : – India gk

Contact for website Design and development – Chaturbhuja Sons