100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

C Language 100 Questions Answers

Puntuación
-
Vendido
-
Páginas
19
Grado
A+
Subido en
17-07-2023
Escrito en
2022/2023

ANS: 1. What does static variable mean? Ans: Static variables are the variables which retain their values between the function calls. They are initialized only once their scope is within the function in which they are defined. 2. What is a pointer? Ans: Pointers are variables which stores the address of another variable. That variable may be a scalar (including another pointer), or an aggregate (array or structure). The pointed-to object may be part of a larger object, such as a field of a structure or an element in an array. 3. What are the uses of a pointer? Ans: Pointer is used in the following cases i) It is used to access array elements ii) It is used for dynamic memory allocation. iii) It is used in Call by reference iv) It is used in data structures like trees, graph, linked list etc. 4. What is a structure? Ans: Structure constitutes a super data type which represents several different data types in a single unit. A structure can be initialized if it is static or global. 5. What is a union? Ans: Union is a collection of heterogeneous data type but it uses efficient memory utilization technique by allocating enough memory to hold the largest member. Here a single area of memory contains values of different types at different time. A union can never be initialized. 6. What are the differences between structures and union? Ans: A structure variable contains each of the named members, and its size is large enough to hold all the members. Structure elements are of same size. A union contains one of the named members at a given time and is large enough to hold the largest member. Union element can be of different sizes. 7. What are the differences between structures and arrays? Ans: Structure is a collection of heterogeneous data type but array is a collection of homogeneous data types. Array 1-It is a collection of data items of same data type. 2-It has declaration only 3-.There is no keyword. 4- array name represent the address of the starting element. Structure 1-It is a collection of data items of different data type. 2- It has declaration and definition 3- keyword struct is used 4-Structure name is known as tag it is the short hand notation of the declaration.

Mostrar más Leer menos
Institución
C Language
Grado
C Language













Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
C Language
Grado
C Language

Información del documento

Subido en
17 de julio de 2023
Número de páginas
19
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

C Language
Questions and
Answers
Abstract
This PDF contains 100+ Q&A on C Language to help you
remind yourself of basic concepts and definitions. Especially
helpful for Interviews and quick references.

, Page 1



1. What does static variable mean?

2. What is a pointer?

3. What are the uses of a pointer?

4. What is a structure?

5. What is a union?

6. What are the differences between structures and union?

7. What are the differences between structures and arrays?

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

9. What are the differences between malloc () and calloc ()?

10. What are macros? What are its advantages and disadvantages?

11. Difference between pass by reference and pass by

12. What is static identifier?

13. Where is the auto variables stored?

14. Where does global, static, and local, register

15. Difference between arrays and linked list?

16. What are enumerations?

17. Describe about storage allocation and scope of

18. What are register variables? What are the advantages

19. What is the use of typedef?

20. Can we specify variable field width in a scanf()

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

22. Difference between strdup and strcpy?

23. What is recursion?




www.cpp-progams.blogspot.com

, Page 2



24. Differentiate between a for loop and a while loop? What are it uses?

25. What is storage class.What are the different storage classes in C?

26. What the advantages of using Unions?

27. What is the difference between Strings and Arrays?

28. What is a far pointer? where we use it?

29. What is a huge pointer?

30. What is a normalized pointer ,how do we normalize a pointer?

31. What is near pointer.

32. In C, why is the void pointer useful? When would you use it?

33. What is a NULL Pointer? Whether it is same as an uninitialized pointer?

34. Are pointers integer ?

35. What does the error ‘Null Pointer Assignment’ means and what causes this
error?

36. What is generic pointer in C?

37. Are the expressions arr and &arr same for an array of integers?

38. How pointer variables are initialized ?

39. What is static memory allocation ?

40. What is dynamic memory allocation?

41. What is the purpose of realloc ?

42. What is pointer to a pointer.

43. What is an array of pointers ?

44. Difference between linker and linkage ?

45. Is it possible to have negative index in an array?

46. Why is it necessary to give the size of an array in an array declaration ?




www.cpp-progams.blogspot.com

, Page 3



47. What modular programming ?

48. What is a function ?

49. What is an argument ?

50. What are built in functions ?

51. Difference between formal argument and actual argument ?

52. Is it possible to have more than one main() function in a C program ?

53. What is the difference between an enumeration and a set of pre-processor
# defines?

54. How are Structure passing and returning implemented by the complier?

55. What is the similarity between a Structure, Union and enumeration?

56. Can a Structure contain a Pointer to itself?

57. How can we read/write Structures from/to data files?

58. Write a program which employs Recursion ?

59. Write a program which uses Command Line Arguments?

60. Difference between array and pointer ?

61. What do the ‘c’ and ‘v’ in argc and argv stand for?

62. What are C tokens ?

63. What are C identifiers?

64. Difference between syntax vs logical error?

65. What is preincrement and post increment ?

66. Write a program to interchange 2 variables without using the third one.

67. What is the maximum combined length of command line arguments
including the space

between adjacent arguments?




www.cpp-progams.blogspot.com

, Page 4



68. What are bit fields? What is the use of bit fields in a Structure declaration?

69. What is a preprocessor, What are the advantages of preprocessor ?

70. What are the facilities provided by preprocessor ?

71. What are the two forms of #include directive ?

72. How would you use the functions randomize() and random()?

73. What do the functions atoi(), itoa() and gcvt() do?

74. How would you use the functions fseek(), freed(), fwrite() and ftell()?

75. What is the difference between the functions memmove() and memcpy()?

76. What is a file ?

77. What are the types of file?

78. What is a stream ?

79. What is meant by file opening ?

81. What is a file pointer ?

82. How is fopen()used ?

83. How is a file closed ?

84. What is a random access file ?

85. What is the purpose of ftell ?

86. What is the purpose of rewind() ?

87. Difference between a array name and a pointer variable ?

88. Represent a two-dimensional array using pointer ?

89. Difference between an array of pointers and a pointer to an array ?

90. Can we use any name in place of argv and argc as command line arguments
?

91. What are the pointer declarations used in C?




www.cpp-progams.blogspot.com

, Page 5



92. Differentiate between a constant pointer and pointer to a constant ?

93. Is the allocated space within a function automatically deallocated when
the function returns?

94. Discuss on pointer arithmetic?

95. What are the invalid pointer arithmetic ?

96. What are the advantages of using array of pointers to string instead of an
array of strings?

97. Are the expressions *ptr ++ and ++ *ptr same ?

98. What would be the equivalent pointer expression foe referring the same
element as

a[p][q][r][s] ?

99. Are the variables argc and argv are always local to main ?

100. Can main () be called recursively?

101. Can we initialize unions?

102. What’s the difference between these two declarations?

103. Why doesn’t this code: a[i] = i++; work?

104. Why doesn’t struct x { … };x thestruct; work?

105. Why can’t we compare structures?

106. How are structure passing and returning implemented?




www.cpp-progams.blogspot.com
$10.99
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
jeysam

Conoce al vendedor

Seller avatar
jeysam Chamberlain College Of Nursing
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
2 año
Número de seguidores
0
Documentos
148
Última venta
-
A+ solution

Here, you'll find high-quality, well-organized study materials to help you succeed in your academic journey. Whether you're looking for detailed lecture notes, exam summaries, or practical guides, my resources are created to make studying more efficient and effective. All materials are carefully curated, based on reliable sources, and formatted for easy understanding. From key concepts to critical insights, I’ve got you covered! Let’s make learning easier—browse my content and ace your studies today!

Lee mas Leer menos
0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes