- C Programming Tutorial
- C - Home
- C - Overview
- C - Features
- C - History
- C - Environment Setup
- C - Program Structure
- C - Hello World
- C - Compilation Process
- C - Comments
- C - Tokens
- C - Keywords
- C - Identifiers
- C - User Input
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Integer Promotions
- C - Constants
- C - Literals
- C - Escape sequences
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - if statement
- C - if...else statement
- C - nested if statements
- C - switch statement
- C - nested switch statements
- C - Loops
- C - While loop
- C - For loop
- C - Do...while loop
- C - Nested loop
- C - Infinite loop
- C - Break Statement
- C - Continue Statement
- C - goto Statement
- C - Functions
- C - Main Functions
- C - Return Statement
- C - Recursion
- C - Scope Rules
- C - Arrays
- C - Properties of Array
- C - Multi-Dimensional Arrays
- C - Passing Arrays to Function
- C - Return Array from Function
- C - Variable Length Arrays
- C - Pointers
- C - Pointer Arithmetics
- C - Passing Pointers to Functions
- C - Strings
- C - Array of Strings
- C - Structures
- C - Structures and Functions
- C - Arrays of Structures
- C - Pointers to Structures
- C - Self-Referential Structures
- C - Nested Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
C Programming Interview Questions
Dear readers, these C Programming Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of C Programming. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer −
-
What is a pointer on pointer?
Eg: int x = 5, *p=&x, **q=&p;
Therefore ‘x’ can be accessed by **q.
void f() { int i; auto int j; }
NOTE − A global variable can’t be an automatic variable.
for(expression-1;expression-2;expression-3) { //set of statements }
When control reaches for expression-1 is executed first. Then following expression-2, and if expression-2 evaluates to non-zero ‘set of statements’ and expression-3 is executed, follows expression-2.
void f() { static int i; ++i; printf(“%d “,i); }
If a global variable is static then its visibility is limited to the same source code.
Eg: main() { extern int i; Printf(“%d”,i); } int i = 20;
main( int count, char *args[]) { }
T (*fun_ptr) (T1,T2…); Where T is any date type.
Once fun_ptr refers a function the same can be invoked using the pointer as follows.
fun_ptr(); [Or] (*fun_ptr)();
Eg: printf(“hi”) , printf(“Hello”);
Eg: int count = 0; while( ++count<=10 ) ;
Above does nothing 10 times.
E.g. #define MESSAGE "Hi, \ Welcome to C"
void f(int k,…) { }
char *s1 = "hello",*s2 = "welcome"; strcat(s1,s2);
s1 points to a string constant and cannot be altered.
while(0 == 0) { }
int var; void f() { int var; } main() { int var; }
What is Next ?
Further you can go through your past assignments you have done with the subject and make sure you are able to speak confidently on them. If you are fresher then interviewer does not expect you will answer very complex questions, rather you have to make your basics concepts very strong.
Second it really doesn't matter much if you could not answer few questions but it matters that whatever you answered, you must have answered with confidence. So just feel confident during your interview. We at tutorialspoint wish you best luck to have a good interviewer and all the very best for your future endeavor. Cheers :-)