Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7069489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:27:06+00:00 2026-05-28T05:27:06+00:00

This question applies I suppose to programming in general, but my application is built

  • 0

This question applies I suppose to programming in general, but my application is built in MATLAB (based on C++):

In a while loop, if the while condition is no longer satisfied, does the loop run to its completion or does it exit at the exact moment that the conditions of the while loop are no longer satisfied?

e.g.

x = 1
while (x = 1)
{
   x = 0
   (some code)
}

In this case, does (some code) run?

PS. I know the syntax is terrible, it’s just to illustrate the situation

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:27:06+00:00Added an answer on May 28, 2026 at 5:27 am

    It runs to completion. The while is only considered at entry to the loop block. So yes, (some code) does run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I believe this question applies to any of the For Html helpers, but my
I'm using Castle ActiveRecord, but this question applies to NHibernate, too, since a solution
I'm coming largely from a c++ background, but I think this question applies to
(This question specifically in C#, but applies generally to .NET) I have a largish
I'm using IntelliJ IDEA 9.0.2 but I assume this question applies to previous versions
This is a generic question that applies to (probably) any high-level programming language. Here
This question came up while designing a dedicated ACL system for a custom application,
This might be a silly question, but: Suppose an expression depends only on literals,
I suppose this question could just as easily be applied to PHP with regard
I believe this question applies equally well to C# as to Java, because both

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.