Interview Question

What is a variable?

A C variable names a typed object with defined scope and storage duration.

💡 Concept ✅ Quick Revision ⚙ C

Answer

A variable is an identifier that designates an object whose stored value may change. • Its declared type controls representation and valid operations. • Its scope controls where the identifier is visible. • Its storage duration controls how long the object exists.

💡 C Example

int main(void) { int score = 10; score = 15; return score == 15 ? 0 : 1; }

⚡ Quick Revision

A C variable names a typed object with defined scope and storage duration.