c interview questions and answers

c interview questions and answers

Top 150+ C Interview Questions and Answers – Beginner to Advanced 

If you’re preparing for technical interviews, C is still one of the most commonly asked programming languages—especially in companies like TCS, Infosys, Wipro, and product-based firms.

basic to advanced C interview questions, including output-based questions, programs, and real-world concepts.

Basic C Interview Questions (Freshers)

1. What is a static variable?

A static variable retains its value between function calls.


#include <stdio.h>

void func() {
    static int x = 0;
    x++;
    printf("%d ", x);
}

int main() {
    func();
    func();
    func();
    return 0;
}

Output: 1 2 3