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 6158273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:55:47+00:00 2026-05-23T20:55:47+00:00

I encountered a line of code: int a = 10; int b = 40;

  • 0

I encountered a line of code:

int a = 10;
int b = 40;
a = a + b - (b = a);
cout << a << "   " << b << endl;

I cannot understand what happens in this code.
Can anyone explain for me?

  • 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-23T20:55:48+00:00Added an answer on May 23, 2026 at 8:55 pm

    Undefined behavior. the value of b is changed and used for computation without an intervening sequence point. The results of the program are unpredictable – it can print anything or crash, or do do some nasty system calls.

    Except where noted, the order of evaluation of operands of individual
    operators and subexpressions of individual expressions, and the order
    in which side effects take place, is unspecified.53) Between the
    previous and next sequence point a scalar object shall have its stored
    value modified at most once by the evaluation of an expression.
    Furthermore, the prior value shall be accessed only to determine the
    value to be stored. The requirements of this paragraph shall be met
    for each allowable ordering of the subexpressions of a full
    expression; otherwise the behavior is undefined.

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

Sidebar

Related Questions

I encountered this error: cannot convert 'V_DTLPROMO_BTN_FN_T' to 'V_DTLPROD_BTN_FN_T' in argument passing in code
Can someone please explain what does the following line of code exactly do? If
I am hoping someone can help interpret the last code line (@Active=1....) for this
This line of code causes the exceptions shown below: object arg = methodCallMessage.Args[i]; private
I was writing this code on codeblocks(only compiler I m having).When I encountered such
i've found this line of code got error if the input not an number
In my program on this line: int value = MTEConnect(auth_string, err); I receive such
I've encountered some template code that doesn't compile, and I'm not sure I understand
On GAE this line of code: file_name = files.blobstore.create(mime_type='image/png') drops google.appengine.runtime.DeadlineExceededError Here is the
I encountered some troubles with WeakHashMap. Consider this sample code: List<byte[]> list = new

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.