0% found this document useful (0 votes)
58 views2 pages

C Lang Interview Questions

The document contains questions about C programming concepts including data types, variables and their scope, functions, pointers, structures, file operations, typecasting, and differences between macros and functions. It also includes code snippets such as a program to print "hello world" without a semicolon and a program to swap two numbers without a third variable.

Uploaded by

pooja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
58 views2 pages

C Lang Interview Questions

The document contains questions about C programming concepts including data types, variables and their scope, functions, pointers, structures, file operations, typecasting, and differences between macros and functions. It also includes code snippets such as a program to print "hello world" without a semicolon and a program to swap two numbers without a third variable.

Uploaded by

pooja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

1. What are the basic Datatypes supported in C Programming Language?

2. What do you mean by Dangling Pointer Variable in C Programming?


3. What do you mean by the Scope of the variable? What is the scope of the variables in C?
4. What are static variables and functions?
5. Differentiate between calloc() and malloc()
6. What are the valid places where the programmer can apply Break Control Statement?
7. How can we store a negative integer?
8.  Differentiate between Actual Parameters and Formal Parameters.
9. Can a C program be compiled or executed in the absence of a main()?
10. What do you mean by a Nested Structure?
11. What is a C Token?
12. What is Preprocessor?
13. Why is C called the Mother of all Languages?
14. Mention the features of C Programming Language.
15. What is the purpose of printf() and scanf() in C Program?
16. What is an array?
17. What is \0 character?
18. What is the main difference between the Compiler and the Interpreter?
19. Can I use int datatype to store 32768 value?
20.  How is a Function declared in C Language?
21. What is Dynamic Memory allocation? Mention the syntax. 
22. What do you mean by Dangling Pointer Variable in C Programming?
23. Where can we not use &(address operator in C)?
24. Write a simple example of a structure in C Language
25. Differentiate between call by value and call by reference
26. Differentiate between getch() and getche()
27. Explain toupper() with an example.
28. Write a code to generate random numbers in C Language
29. Can I create a customized Head File in C language?
30. What do you mean by Memory Leak?
31. Explain Local Static Variables and what is their use?
32. What is the difference between declaring a header file with < > and ” “?
33. When should we use the register storage specifier?
34. Which statement is efficient and why? x=x+1; or x++; 
35. Can I declare the same variable name to the variables which have different scopes?
36. Which variable can be used to access Union data members if the Union variable is declared as a
pointer variable?
37. Mention File operations in C Language.
38. What are the different storage class specifiers in C?
39. What is typecasting?
40. Write a C program to print hello world without using a semicolon ;
if(printf("hello world")){}
41. Write a program to swap two numbers without using the third variable.
42.  How can you print a string with the symbol % in it?
43. Explain the # pragma directive.
44. Explain the # pragma directive.
45.  Which structure is used to link the program and the operating system?
46. What are the limitations of scanf() and how can it be avoided?
47. Differentiate between the macros and the functions.

Ans: The differences between macros and functions can be explained as follows:

Macro call replaces the templates with the expansion in a literal way.

The Macro call makes the program run faster but also increases the program size.

Macro is simple and avoids errors related to the function calls.

In a function, call control is transferred to the function along with arguments.

It makes the functions small and compact.

Passing arguments and getting back the returned value takes time and makes the program run at a slower
rate.

48.Suppose a global variable and local variable have the same name. Is it is possible to access a global
variable from a block where local variables are defined?

Ans: No. It is not possible in C. It is always the most local variable that gets preference.

With this, we come to an end of this “C Programming Interview Questions” article. I hope you have understood the
importance of C Programming.

48. #include<stdio.h>     
49. void main()
50. {     
51.       if(printf("hello world")){}
52. }

53.

You might also like