PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Bitkernel

Evaluate C for-loop execution count

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of C expression evaluation and control-flow semantics, focusing on how assignment expressions interact with loop conditions and variable updates.

  • medium
  • Bitkernel
  • Software Engineering Fundamentals
  • Software Engineer

Evaluate C for-loop execution count

Company: Bitkernel

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Take-home Project

In C, variables `m` and `n` are both of type `int`. Consider the following code: ```c int m, n; for (m = 0, n = -1; n = 0; m++, n++) n++; ``` In standard C semantics (where `=` is assignment, not comparison), how many times does the loop body (`n++` inside the loop) execute? Options: - A. The loop body executes 0 times - B. The loop body executes 1 time - C. The loop is infinite - D. There is a runtime error

Quick Answer: This question evaluates understanding of C expression evaluation and control-flow semantics, focusing on how assignment expressions interact with loop conditions and variable updates.

Related Interview Questions

  • Trace first pass of heap sort - Bitkernel (medium)
  • Find minimum two’s-complement value with three ones - Bitkernel (medium)
  • Identify incorrect statement about sockets - Bitkernel (medium)
  • Solve cups logic puzzle with one true statement - Bitkernel (medium)
  • Choose unsuitable file structure for random access - Bitkernel (medium)
|Home/Software Engineering Fundamentals/Bitkernel

Evaluate C for-loop execution count

Bitkernel logo
Bitkernel
Oct 24, 2025, 12:00 AM
mediumSoftware EngineerTake-home ProjectSoftware Engineering Fundamentals
2
0

In C, variables m and n are both of type int. Consider the following code:

int m, n;
for (m = 0, n = -1; n = 0; m++, n++)
    n++;

In standard C semantics (where = is assignment, not comparison), how many times does the loop body (n++ inside the loop) execute?

Options:

  • A. The loop body executes 0 times
  • B. The loop body executes 1 time
  • C. The loop is infinite
  • D. There is a runtime error
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Bitkernel•More Software Engineer•Bitkernel Software Engineer•Bitkernel Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.