Skip to content

Iamhasan69/C-Programming-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

C-Programming IMP Questions

Important Questions for C Programming

  1. Basic Concepts

  2. What are the main features of C programming language?

  3. Explain the structure of a C program.

  4. What are variables in C? List the rules for naming a variable.

  5. What are data types in C? Explain with examples.

  6. What are constants? How are they different from variables?

  7. Control Structures

  8. Differentiate between if-else and switch statements with examples.

  9. Write a program to find the largest of three numbers using if-else.

  10. Explain the syntax and usage of the for, while, and do-while loops.

  11. Write a program to print the Fibonacci series up to n terms using a loop.

  12. What are break and continue statements? Explain with examples.

  13. Functions

  14. What is the difference between a library function and a user-defined function?

  15. Explain actual and formal arguments with an example.

  16. Write a program to find the factorial of a number using recursion.

  17. What is the purpose of the return statement in a function?

  18. Explain the concept of call by value and call by reference.

  19. Arrays and Strings

  20. Explain how arrays are declared and initialized in C. Provide examples.

  21. Write a program to find the largest element in an array.

  22. What is the difference between one-dimensional and two-dimensional arrays?

  23. Write a program to concatenate two strings without using library functions.

  24. Explain any four string-handling functions with examples.

  25. Pointers

  26. What is a pointer in C? How is it declared?

  27. Write a program to swap two numbers using pointers.

  28. Explain the relationship between arrays and pointers.

  29. What is NULL pointer? Explain its use.

  30. What are dangling pointers? How can they be avoided?

  31. Structures and File Handling

  32. What is a structure in C? How is it different from an array?

  33. Write a program to store and display information of 5 students using structures.

  34. Explain different file-opening modes in C.

  35. Write a program to read and write data into a file.

  36. What is the difference between text files and binary files?

  37. Advanced Topics

  38. Explain dynamic memory allocation in C. Provide examples using malloc() and free().

  39. What is the use of the sizeof operator? Provide examples.

  40. Write a program to implement a simple calculator using functions.

  41. What is a preprocessor directive? Explain #define and #include.

  42. What are command-line arguments? Write a program to demonstrate their use.

  43. Miscellaneous

  44. Explain the use of the typedef keyword with examples.

  45. Write a program to reverse a given string.

  46. Explain the difference between stack and heap memory allocation.

  47. What is an infinite loop? Provide an example.

  48. Write a program to find whether a number is prime or not.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published