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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:30:16+00:00 2026-06-07T05:30:16+00:00

Does the output of the code given below depends on the compiler or it

  • 0

Does the output of the code given below depends on the compiler or it is guaranteed to be same for all the compilers?

int main()
{ 
    int i=5;
    i=i/3;
    printf("%d\n",i);
    return 0;
}
  • 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-06-07T05:30:18+00:00Added an answer on June 7, 2026 at 5:30 am

    Yes, the behaviour of your example is well-defined.

    However, in the case of negative values, it is less clear. Pre-C99, whether integer division was rounded towards zero or towards negative infinity was left as implementation-defined:

    If either operand is negative, whether the
    result of the / operator is the largest integer less than the
    algebraic quotient or the smallest integer greater than the algebraic
    quotient is implementation-defined

    C99 mandates rounding towards zero:

    When integers are divided, the result of the / operator is the algebraic quotient with any
    fractional part discarded..

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

Sidebar

Related Questions

While debugging some code I got something like below: #include<stdio.h> int main() { FILE
Does it have something to do with output? So, <%= ...code... %> is used
All it does is output 'CHECK' which I put in to make sure it
Does the Microsoft C# compiler (CSC.exe) have an option to output the Intermediate Language
The below given code of is taking infinitely long time to load in a
Kind of need help understanding what this code actually outputs. Does it out put
Why does this output a 0 byte file? <?php $jsonurl = http://do.convertapi.com/Web2Pdf/json/?curl=http://stackoverflow.com/; $json =
Where does console.writeline output in a webservice go to?
Does libjpeg allows/have routines to scale the output image? I have an image which
Does a tool exist that can parse text and output that text, hyper-linked to

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.