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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:00:06+00:00 2026-05-31T17:00:06+00:00

While solving exercises from the K&R C book, I stumbled upon the exercise 2.1.

  • 0

While solving exercises from the K&R C book, I stumbled upon the exercise 2.1.

At first I got as UINT_MAX as -1, but then I used the %u placeholder, but now its giving me the same number as ULONG_MAX.

In the book in Appendix B, they say that UINT_MAX should be 65535 and ULONG_MAX should be 4294967295, but when running the exercise, its giving me for both UINT_MAX and ULONG_MAX as 4294967295.

Why is that?

  • 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-31T17:00:07+00:00Added an answer on May 31, 2026 at 5:00 pm

    First of all, the right way to print an unsigned long is not %u but %lu. Second, the standard says the minimum value of UINT_MAX is 65535. It can be (and usually is) larger.

    5.2.4.2.1 Sizes of integer types

    Their implementation-defined values shall be equal or greater in
    magnitude
    (absolute value) to those shown, with the same sign.

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

Sidebar

Related Questions

While solving a DP related problem, I observed that first works but the second
I'm solving this K&R exercise: Write versions of the library functions strncpy , strncat
I'm solving a problem that consist in generate the first n<1000000 lucky numbers, but
While going through university and from following the development of SO, I've heard a
a collegue of mine proposed to me an exercise from an online judge website,
While solving some Project Euler Problems to learn Haskell (so currently I'm a completly
I am Just a begineer in C Programming. While solving a programming assignement I
While solving a geometry problem, I came across an approach called Sliding Window Algorithm.
I encountered this problem while solving a practice test Consider the following code written
I encountered this problem while solving a practice test Consider this C code 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.