MCQ on Loops in C — 40 Questions with Answers
  • Twitter
  • Facebook
  • Snapchat
  • Instagram

MCQ, Multiple Choice Questions on Loops in C

📑 On this page:
  • while Loop Basics
  • while Loop Output Questions
  • do-while Loop
  • for Loop
  • Nested Loops
  • break, continue & Infinite Loops
  • Frequently Asked Questions
MCQ on looping statements in C including while loop, do-while loop, for loop, and nested loops with output questions
MCQ on loops in C — practice set with answers and simple explanations.
📚 In this quiz, you will revise:
  • How while, do-while, and for loops work in C
  • When the condition is checked in each loop type
  • The role of initialization, condition, and increment
  • How break and continue change loop behaviour
  • How nested loops execute (and why inner loops matter)
  • How to trace output of loops step by step
  • Common pitfalls like infinite loops and undefined behaviour

This page has 40 multiple choice questions on loops in C. You'll find questions on while, do-while, and for loops, plus a set of nested-loop and output-tracing questions that test how well you can read code. Each question comes with the correct answer and a short explanation in plain English, so you understand why an option is right and not just what it is. These MCQs are useful for beginners preparing for college exams, interviews, or any C programming test. Some questions involve running code in your head — take them slowly, one line at a time.

while Loop Basics

Q1. Which one is the syntax of a while loop in C?

  • A) while {condition} { }
  • B) while(condition)
  • C) while {condition}
  • D) while(condition) { }

Answer: D) while(condition) { }

The condition goes inside parentheses, and the loop body is enclosed in curly braces. Option B is missing the body, and options A and C use curly braces around the condition, which is wrong. Getting the syntax right the first time saves you from confusing compiler errors.

Q2. How many times does the following loop execute?

int p = 0;
while(p < 15) {
    p++;
}
  • A) 14
  • B) 15
  • C) 16
  • D) error

Answer: B) 15

p starts at 0 and increases by 1 each time. The loop runs while p is less than 15 — that is, for p = 0, 1, 2, ..., 14. That's exactly 15 iterations. When p becomes 15, the condition p < 15 is false and the loop ends.

Q3. Identify the correct way to exit a while loop normally (before its condition becomes false) in C.

  • A) return;
  • B) exit(0);
  • C) continue;
  • D) break;

Answer: D) break;

The break statement exits the loop and jumps to the next statement after it. return exits the whole function, and exit(0) ends the program — both are heavier than just exiting the loop. continue is the opposite of break: it skips the rest of the current iteration but keeps the loop running.

Q4. What happens if the condition in a while loop is always true?

  • A) The loop runs indefinitely
  • B) The loop runs only once
  • C) The loop never executes
  • D) The program crashes

Answer: A) The loop runs indefinitely

If the condition never becomes false, the loop keeps running forever — this is called an infinite loop. The program doesn't crash automatically; it just freezes. To stop it, you'd need break, return, exit(), or for the operating system to kill the process. That's why it's important to make sure your loop condition will eventually become false.

Q5. What is the purpose of a while loop in C?

  • A) To exit the program immediately
  • B) To iterate over a collection of elements
  • C) To execute a block of code a fixed number of times
  • D) To check a condition before executing the loop body

Answer: D) To check a condition before executing the loop body

A while loop is a "pre-test" loop: the condition is tested first, and only if it's true does the body run. If the condition is false from the start, the body never runs at all. This is different from do-while, which runs the body at least once regardless.

Q6. Which of the following is an infinite loop in C?

  • A) while(i != 0) {}
  • B) while(i > 0) {}
  • C) while(i < 10) {}
  • D) while(1) {}

Answer: D) while(1) {}

In C, any non-zero value is true, and 1 is always non-zero. So while(1) is always true and the loop never ends. Options A, B, and C depend on the value of i — they will end when i reaches a certain value. This makes while(1) the standard way to write an intentional infinite loop.

Q7. What is the initializer in a while loop in C?

  • A) To initialize variables before the loop starts
  • B) To specify the number of iterations
  • C) To increment or decrement the loop variable
  • D) To set the condition for exiting the loop

Answer: A) To initialize variables before the loop starts

A while loop doesn't have a formal "initializer" — you write any setup code before the loop yourself. For example, int i = 0; appears before the while, not inside it. That line is the initializer. The for loop is different: it has a dedicated initialization section inside the for(...) itself.

Q8. What is the purpose of the increment (++)/decrement (--) statement in a while loop?

  • A) To set the exit condition of the loop
  • B) To check the condition before executing the loop
  • C) To initialize variables before the loop starts
  • D) To change the loop variable's value each iteration so the loop eventually ends

Answer: D) To change the loop variable's value each iteration so the loop eventually ends

Without changing the loop variable, the condition would never become false, and the loop would run forever. Incrementing or decrementing moves the variable towards the exit condition. This is why forgetting i++ inside a while loop is one of the most common beginner bugs — instant infinite loop.

Q9. What is the importance of the condition in a while loop?

  • A) To exit the program immediately
  • B) To increment or decrement the loop variable
  • C) To decide whether to execute the loop or not
  • D) To set the initial value of variables

Answer: C) To decide whether to execute the loop or not

The condition is the gatekeeper of the while loop. Every iteration, before running the body, the condition is checked. If it's true, the body runs; if it's false, the loop exits. Without a correct condition, the loop either won't run at all or won't stop — both are problems.

while Loop Output Questions

Q10. What is the output of the following code snippet?

int x = 1;
while(x < 13) {
    printf("%d ", x);
    x += 2;
}
  • A) 1 2 3 4 5 6 7 8 9 10
  • B) 1 3 5 7 9
  • C) 1 3 5 7 9 11
  • D) 1 2 3 4 5 6 7 8 9

Answer: C) 1 3 5 7 9 11

x starts at 1 and increases by 2 each time. So it takes the values 1, 3, 5, 7, 9, 11 — all less than 13. Each value gets printed. When x becomes 13, the condition x < 13 is false and the loop ends. Notice that 13 is not printed because the check happens before the print.

Q11. Find the output of the following code.

int p = 5;
while(p > 2) {
    printf("%d ", p);
    p--;
}
  • A) 5 4 3
  • B) 4 3 2 1
  • C) 5 4 3 2
  • D) 1 2 3 4 5

Answer: A) 5 4 3

p starts at 5 and decreases by 1 each time. The loop continues while p > 2, so it prints 5, 4, 3. When p becomes 2, the condition p > 2 is false and the loop stops. The number 2 itself is never printed.

Q12. Find the value of x after the program finishes.

int x = 5;
while(x > 0) {
    x -= 5;
}
  • A) 5
  • B) 15
  • C) -5
  • D) 0

Answer: D) 0

x starts at 5. The first iteration subtracts 5, so x becomes 0. Then the condition x > 0 is checked: 0 > 0 is false, so the loop ends. The final value of x is 0. Note that x does not go negative — the loop exits exactly when x hits 0.

Q13. Trace the output of the following code.

int p = 10;
while(p > 0) {
    printf("%d ", p);
    p -= 2;
}
  • A) 10 8 6 4 2
  • B) 10 7 4 3
  • C) 10 8 7 6
  • D) 10 9 8 7 5 4 2 0

Answer: A) 10 8 6 4 2

p starts at 10 and decreases by 2 each time: 10, 8, 6, 4, 2. When p becomes 0, the condition p > 0 is false and the loop ends. So the printed sequence is 10 8 6 4 2 — all even numbers down to 2, and 0 is not printed.

Q14. Find the value of tot after the code finishes running.

int tot = 0;
int i = 1;
while(i <= 10) {
    tot += i;
    i++;
}
  • A) 36
  • B) 55
  • C) 49
  • D) 28

Answer: B) 55

This is the classic sum-of-first-N-numbers pattern. It adds 1 + 2 + 3 + ... + 10. The formula is n(n+1)/2 = 10×11/2 = 55. So tot becomes 55. This pattern appears in almost every C course — memorise it.

do-while Loop

Q15. Which is the syntax for a do-while loop in C?

  • A) while(condition) do { }
  • B) do while(condition) { }
  • C) do { } while(condition);
  • D) do(condition) { } while;

Answer: C) do { } while(condition);

The do-while loop starts with the keyword do, then the body in braces, then the keyword while followed by the condition in parentheses — and critically, a semicolon at the end. Forgetting that trailing semicolon is a common beginner mistake and a compiler error.

Q16. In a do-while loop, the condition is checked:

  • A) at the same time as the loop body is executed
  • B) before the loop body is executed
  • C) after the loop body is executed
  • D) none of the above

Answer: C) after the loop body is executed

That's the whole point of a do-while loop — it's a "post-test" loop. The body runs first, then the condition is checked. If the condition is true, the loop repeats. That's why the body always runs at least once, even when the condition is false from the very beginning.

Q17. What will happen if the condition in a do-while loop is never true?

  • A) The loop runs indefinitely
  • B) The loop runs at least once
  • C) The program crashes
  • D) The loop never executes

Answer: B) The loop runs at least once

This is the defining feature of a do-while loop. The body runs first, and only then is the condition checked. So even if the condition is false from the start, the body has already executed once. Use this when you want to guarantee at least one pass — like reading a user's menu choice.

Q18. Which of the following is not strictly necessary in a do-while loop?

  • A) Initialization
  • B) Loop body
  • C) Increment
  • D) Condition

Answer: A) Initialization

A do-while loop must have a body and a condition — those are part of its syntax. Initialization and increment are not part of the syntax; they are written before and inside the loop by the programmer. That's why the syntax of a do-while is do { ... } while(condition); — no initializer or increment section like a for loop has.

Q19. How many times will the following do-while loop execute?

int i = 0;
do {
    i++;
} while (i < 0);
  • A) 0
  • B) 1
  • C) 4
  • D) 5

Answer: B) 1

The body runs first, so i++ makes i = 1. Then the condition i < 0 is checked: 1 < 0 is false, so the loop ends. Result: the body ran exactly once. This is a classic do-while trap — even when the condition is false from the start, the body runs once.

Q20. Which of the following statements executes at least once?

  • A) while loop
  • B) if statement
  • C) do-while loop
  • D) for loop

Answer: C) do-while loop

Only the do-while loop is guaranteed to run its body at least once. while, for, and if all check the condition first — if it's false on the very first check, the body never runs. This is a favourite exam question, so remember: do-while = "at least once."

Q21. What does the following code snippet do?

int p = 9;
do {
    printf("%d ", p);
    p--;
} while (p > 5);
  • A) Prints numbers from 9 to 5
  • B) Prints numbers from 1 to 9
  • C) Prints numbers from 9 to 1
  • D) Prints numbers from 5 to 9

Answer: A) Prints numbers from 9 to 5

p starts at 9. Each iteration prints p, then decrements by 1, then checks p > 5. So it prints 9, then p becomes 8; prints 8, then p becomes 7; and so on — until p becomes 5. The final check: 5 > 5 is false, so the loop ends. Output: 9 8 7 6 5.

Q22. Which of the following is true about the do-while loop in C?

  • A) It can only execute once
  • B) It does not have a condition
  • C) It is a pre-test loop
  • D) It is a post-test loop

Answer: D) It is a post-test loop

"Post-test" means the condition is tested after the body runs. The opposite is "pre-test" — while and for loops are pre-test loops. This naming makes it easy to remember: pre-test = test first (may run 0 times), post-test = test last (runs at least once).

Q23. What is the biggest difference between a do-while loop and a while loop?

  • A) There is no difference between them
  • B) In a do-while loop, the condition is checked before the loop body is executed
  • C) In a do-while loop, the loop body is executed at least once
  • D) In a while loop, the loop body is executed at least once

Answer: C) In a do-while loop, the loop body is executed at least once

This is the only guaranteed difference. Both check the condition eventually — the difference is when. In a while loop, the condition is checked first, so the body may never run. In a do-while loop, the body runs first, so it always runs at least once, then the condition is checked.

Q24. In which situation would you prefer a do-while loop over a while loop?

  • A) When the loop needs to run indefinitely
  • B) When the loop body should not be executed at all
  • C) When the loop body needs to be executed at least once
  • D) When there are multiple conditions to be checked

Answer: C) When the loop body needs to be executed at least once

Common scenarios: reading a menu choice from a user (you must show the menu at least once), validating input (you must ask the first time), and retry loops (the first attempt must happen regardless). All of these fit the do-while pattern.

Q25. What will happen when the condition in a do-while loop always remains true?

  • A) The loop executes once
  • B) The program crashes
  • C) The loop never executes
  • D) The loop executes indefinitely

Answer: D) The loop executes indefinitely

If the condition is always true, the loop never exits — same as an infinite while loop. Just like with a while loop, you'd need break, return, or exit() to escape. The do-while structure doesn't protect you from infinite loops; it only guarantees at least one iteration.

Q26. How can a variable be incremented inside a while or do-while loop?

  • A) i += 1
  • B) i++
  • C) i = i++
  • D) Only A and B are correct

Answer: D) Only A and B are correct

Both i += 1 and i++ correctly increment the variable by 1. Option C (i = i++) is undefined behaviour in C — it modifies i twice between sequence points, which the C standard says can produce any result. Never write code like i = i++; it's a well-known trap and can behave differently on different compilers.

for Loop

Q27. How many times will the following loop execute?

for(int i = 20; i >= 10; i -= 2) {
    // Some code
}
  • A) 10 times
  • B) 6 times
  • C) 5 times
  • D) Infinitely

Answer: B) 6 times

The variable i takes the values 20, 18, 16, 14, 12, 10 — all greater than or equal to 10. That's 6 values, so 6 iterations. When i becomes 8, the condition i >= 10 is false and the loop ends. Quick check: (20 − 10) / 2 + 1 = 5 + 1 = 6.

Q28. What will be the output of the following loop?

for(int x = 5; x > 0; x -= 1) {
    printf("%d ", x);
}
  • A) 5 4 3 2 1
  • B) 4 2
  • C) 5 3
  • D) 5 3 1

Answer: A) 5 4 3 2 1

x starts at 5 and decreases by 1 each time, and the loop runs while x > 0. So it prints 5, 4, 3, 2, 1. When x becomes 0, the condition is false and the loop ends. This is the classic "countdown" pattern — the simplest use of a for loop.

Q29. What will be the output of the following loop?

int j = 0;
while(j < 5) {
    printf("%d ", j * 2);
    j += 1;
}
  • A) 2 4 6 8 2
  • B) 0 2 4 6 8
  • C) 0 2 4 6 8 10
  • D) 4 6 8 10

Answer: B) 0 2 4 6 8

j goes from 0 to 4 (five values, all less than 5). Each iteration prints j × 2. So it prints 0, 2, 4, 6, 8. When j becomes 5, the condition j < 5 is false and the loop ends. The value 10 is never printed because the loop exits before that iteration.

Q30. Which of the following is the correct nested for loop in C?

  • A) for(i = 0; i < n; i++) { for(j = 0; j < m) { // code } }
  • B) for(i = 0; i < n; i++) { for(j = 0; j < m; j++) { // code }
  • C) for(i = 0; i < n) { for(j = 0; j < m; j++) { // code } }
  • D) for(i = 0; i < n; i++) { for(j = 0; j < m; j++) { // code } }

Answer: D) for(i = 0; i < n; i++) { for(j = 0; j < m; j++) { // code } }

Every for loop needs all three parts: initialization, condition, and increment. Option A is missing the inner increment, B is missing a closing brace, and C is missing the outer increment. Only D has correct syntax for both loops and matching braces.

Q31. How do you create an infinite loop in C?

  • A) do { } while(1)
  • B) for(;;) { }
  • C) while(1) { }
  • D) All of the above

Answer: D) All of the above

C gives you several ways to write an intentional infinite loop. while(1) and do-while(1) both test a non-zero (true) condition. for(;;) is a for loop with no condition at all — C treats the missing condition as always true. All three are valid and used in real code (like event loops or servers).

Nested Loops

Q32. What will be the output of the following nested loop?

for(int x = 0; x < 4; x++) {
    for(int y = 0; y < 2; y++) {
        if(y == 1) {
            break;
        }
        printf("%d %d ", x, y);
    }
}
  • A) 0 0
  • B) 0 0 0 1 1 0 1 1 2 0 3 0
  • C) 0 0 1 0 2 0 3 0
  • D) 0 0 1 1 2 0 3 0

Answer: C) 0 0 1 0 2 0 3 0

The inner loop runs y = 0, then y = 1. When y == 1, break exits the inner loop immediately — so printf never runs for y = 1. Only the y = 0 print happens each outer iteration. The outer loop runs x = 0, 1, 2, 3, printing "0 0", "1 0", "2 0", "3 0". That's option C.

Q33. What happens if the break statement is used inside a nested loop?

  • A) All loops are exited immediately
  • B) The entire program terminates
  • C) Only the innermost loop is exited
  • D) The outer loop skips one iteration

Answer: C) Only the innermost loop is exited

In a nested loop, break only affects the loop it's directly inside — that is, the innermost one. The outer loops continue as if nothing happened. If you need to break out of multiple loops, you'd use a flag variable or restructure the code into a function with a return.

break, continue & Loop Keywords

Q34. Which keyword is used to skip the current iteration of a loop?

  • A) break;
  • B) continue;
  • C) pass;
  • D) skip;

Answer: B) continue;

continue skips whatever is left in the current iteration and jumps straight to the next iteration's condition check (or the increment step, in a for loop). break, by contrast, exits the loop entirely. pass and skip are not C keywords — pass is Python, and skip doesn't exist in C.

Q35. Which keyword is used to exit a loop in C?

  • A) break;
  • B) return;
  • C) exit;
  • D) continue;

Answer: A) break;

break is the dedicated keyword for exiting a loop. return exits the entire function (which may contain other code after the loop), and exit() ends the whole program — both are heavier. continue does the opposite of exit — it keeps the loop going but skips one iteration.

Q36. What is the difference between break and continue in a loop?

  • A) They do the same thing
  • B) break skips the current iteration, continue exits the loop
  • C) break exits the loop entirely, continue skips only the current iteration
  • D) Neither affects the loop

Answer: C) break exits the loop entirely, continue skips only the current iteration

This is a must-remember distinction. break = "I'm done, exit the loop." continue = "Skip the rest of this iteration, but keep looping." Many beginners mix these up because they sound similar. If you want to stop looping, use break. If you want to skip one bad value and move on, use continue.

Q37. Which loop is best when the number of iterations is known in advance?

  • A) while loop
  • B) do-while loop
  • C) for loop
  • D) goto

Answer: C) for loop

The for loop packs all three pieces into one line: initialization, condition, and increment. When you know exactly how many times to run (like "repeat 10 times" or "for each element in the array"), the for loop is the cleanest choice. For unknown iteration counts, use while. For at-least-once scenarios, use do-while.

Q38. What is the output of the following do-while loop that increments a counter and prints it, starting at 0, until counter < 3?

int counter = 0;
do {
    counter++;
    printf("%d ", counter);
} while (counter < 3);
  • A) 0 1 2
  • B) 1 2 3
  • C) 1 2
  • D) 0 1 2 3

Answer: B) 1 2 3

Notice the order: increment, then print, then check. So the first iteration increments counter to 1, prints 1, checks 1 < 3 (true). Second iteration: 2, prints 2, checks (true). Third iteration: 3, prints 3, checks 3 < 3 (false) — loop ends. Output: 1 2 3. The initial 0 is never printed because the increment happens before the print.

Q39. In a nested loop with two levels, if the outer loop runs m times and the inner runs n times per outer iteration, how many total iterations occur?

  • A) m + n
  • B) m × n
  • C) m − n
  • D) m / n

Answer: B) m × n

Each outer iteration runs the inner loop n times, and there are m outer iterations. So total inner-body executions = m × n. For example, a 3-row, 4-column table loop runs the inner body 12 times. This is exactly how nested loops print 2D grids, multiplication tables, and star patterns.

Q40. What is the output of the following loop?

int i = 0;
while (i < 5) {
    i++;
    if (i == 3) {
        continue;
    }
    printf("%d ", i);
}
  • A) 1 2 3 4 5
  • B) 1 2 4 5
  • C) 1 2 3
  • D) 1 4 5

Answer: B) 1 2 4 5

The loop increments i first, then checks if i == 3. When i becomes 3, continue skips the printf for that iteration — but the loop keeps running. So 3 is never printed, and the output is 1 2 4 5. This is a classic "skip a specific value" pattern using continue.

Frequently Asked Questions

What is the difference between while, do-while, and for loops in C?

A while loop checks the condition before running the body. A do-while loop runs the body at least once, then checks the condition. A for loop is best when you know how many times to run — it combines initialization, condition, and increment in one line. All three can express the same logic; choose the one that reads most clearly for the situation.

When should I use a do-while loop instead of a while loop?

Use do-while when the body must run at least once regardless of the condition. Common cases are menu-driven programs (you must show the menu first), input validation (you must ask at least once), and retry loops. If the very first check could be false and that should skip the body entirely, use a while loop instead.

What does the break statement do inside a nested loop?

break only exits the innermost loop where it appears. The outer loops continue running as normal. If you need to exit multiple loops at once, use a flag variable (int done = 0; check it in the outer condition), restructure the code into a function with a return statement, or use goto (rarely recommended for readability reasons).

Why is i = i++ considered undefined behaviour in C?

i = i++ modifies i twice between sequence points — once by the post-increment, and once by the assignment. The C standard says such an expression has undefined behaviour, which means the compiler can produce literally any result (sometimes 1, sometimes the old value, sometimes a crash). Never write code like i = i++. Use i++ or i += 1 on its own line, or i = i + 1 if you prefer explicit style.

How do I create an infinite loop in C, and how do I break out of it?

The most common ways to write an infinite loop are while(1) { }, for(;;) { }, and do { } while(1). All three are valid and used in real code. To exit such a loop, place a break; inside the body where you want to stop, or use return to leave the enclosing function, or exit() to end the program entirely.

💡 Tip: Loops are the most-tested topic in C exams after operators. Practise tracing output by running small loops in your head, line by line. Pay special attention to the order of operations — whether i++ happens before or after a printf can change the answer completely.

📖 Related MCQ Pages

  • Introduction to C MCQ
  • Operators MCQ
  • Conditional Statements MCQ
  • Arrays MCQ
  • Functions MCQ
  • Structures MCQ
  • Pointers MCQ
  • Files MCQ
  • Storage Classes MCQ
  • Dynamic Memory MCQ

Previous Topic: -->> Conditional Statements MCQ   ||   Next topic: -->> Arrays MCQ


C Language

  • Home
  • Why C Language
  • History of C Language
  • Applications of C Language
  • Introduction To C
    • What is Program?
    • Structure of C Program
    • Working Of C Program
    • CHARACTER SET
    • VARIABLES AND IDENTIFIERS
    • BUILT-IN DATA TYPES
    • OPERATORS AND EXPRESSIONS
    • CONSTANTS AND LITERALS
    • SIMPLE ASSIGNMENT STATEMENT
    • BASIC INPUT/OUTPUT STATEMENT
    • SIMPLE 'C' PROGRAMS
    • Assignments
  • Operators in C Programming
    • Arithmetic Operators
    • Assignment Operators
    • Increment and Decrement Operators
    • Relational Operators
    • Logical Operators
    • Bitwise Operators
    • Other Operators
    • Assignments
  • Conditional Statements
    • DECISION MAKING WITHIN A PROGRAM
    • CONDITIONS
    • IF STATEMENT
    • IF-ELSE STATEMENT
    • IF-ELSE LADDER
    • NESTED IF-ELSE
    • SWITCH CASE
    • Assignments
  • Loops Statements
    • Introduction to Loops
    • GO TO Statement
    • Do while Loop
    • While Loop
    • Nested While Loop
    • Difference Between While and Do while
    • Difference Between Goto and loop
    • while loop assignments
    • C FOR Loop
    • C For loop examples
    • Nested for loop
    • Nested for loop examples
    • Infinite while Loops
    • Infinite for Loops
    • Continue in Loops
    • break in Loops
    • difference while do..while & for
    • Assignments
  • Arrays
    • One Dimensional Array
    • Declaring 1D Arrays
    • Initilization of 1D arrays
    • Accessing element of one 1D Array
    • Read and Display 1D Arrays
    • Two Dimensional Arrays
    • Declare 2D Arrays
    • Read and Display 2D Arrays
    • Assignments/Examples
  • Functions
    • Introduction
    • Need For User-Defined Function
    • Multiple Function Program
    • Modular Programming
    • Elements Of User Defined Function
    • Function Definition
    • Function Declaration
    • Types of functions
    • Nesting of Function
    • Recursion
    • Passing Array To Functions
    • Scope,Visibility and Lifetime of Variables
    • Assignments
  • Structure
    • Introduction
    • Array vs Structure
    • Defining Structure
    • Declaring Structure Variables
    • Type Defined Structure
    • Accessing Structure Members
    • Structure Initilization
    • Copying & Comparing Structure Variables
    • Array of Structure
    • Arrays Within Structure
    • Structures Within Structures
    • Structures and Functions
    • Structure Examples/Assignments
  • Union
    • Define Union
    • Create and use Union
    • Difference Between Structure and Union
    • Union Examples
    • Union FAQ
  • Pointers
    • What Are Pointers In C?
    • How Do We Use Pointers In C?
    • Declaration Of A Pointer
    • The Initialization Of A Pointer
    • Syntax Of Pointer Initialization
    • Use Of Pointers In C
    • The Pointer To An Array
    • The Pointer To A Function
    • The Pointer To A Structure
    • Types Of Pointers
    • The Null Pointer
    • The Void Pointer
    • The Wild Pointer
    • The Near Pointer
    • The Huge Pointer
    • The far Pointer
    • dangling pointer
    • Accessing Pointers- Indirectly And Directly
    • Pros Of Using Pointers In C
    • Cons Of Pointers In C
    • Applications Of Pointers In C
    • The & Address Of Operator In C
    • How To Read The Complex Pointers In C?
    • Practice Problems On Pointers
  • File Processing
    • File Handling In C
    • Types Of Files In C
    • Operations Done In File Handling
    • File Examples
    • Binary Files
    • count words,lines in a file
    • Copy files
    • Update File
    • count vowels in a file
  • Preprocessor
    • Macro substitution division
    • File Inclusion
    • Conditional Compilation
    • Other directives
    • Examples
  • Dynamic Memory Allocation
    • malloc
    • calloc
    • free
    • realloc
    • Examples
  • Storage Classes
  • Graphics
  • Frequently Asked Interview Questions (FAQ)
    • Introduction To C FAQ
    • Operators FAQ
    • Conditional Statements FAQ
    • Loops FAQ
    • Arrays FAQ
    • Function FAQ
    • Structure FAQ
    • Pointers FAQ
    • Files FAQ
    • Storage classes FAQ
    • Dynamic Memory FAQ
  • Programs/Assignments
    • Introduction To C
    • Operators
    • Conditional Statements
    • Loops
    • Arrays
    • Function
    • Structure
    • Pointers
    • Files
    • Storage classes
    • Dynamic Memory
  • Case Studies
  • Multiple Choice Questions
    • Introduction To C MCQ
    • Operators MCQ
    • Conditional Statements MCQ
    • Loops MCQ
    • Arrays MCQ
    • Function MCQ
    • Structure MCQ
    • Pointers MCQ
    • Files MCQ
    • Storage classes MCQ
    • Dynamic Memory MCQ
    • More MCQ

Get in touch

  • tech2dsm@gmail.com

© Sankalan Data Tech. All rights reserved.