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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:41:48+00:00 2026-06-15T12:41:48+00:00

If I use a whole number in #define , what data type is it

  • 0

If I use a whole number in #define, what data type is it considered to be in sprintf() in C99 ?

#define NUMBER 100

sprintf(buf, "%i\n", NUMBER); // is it %i, %u, %lu ?
  • 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-15T12:41:49+00:00Added an answer on June 15, 2026 at 12:41 pm
    #define NUMBER1 100 /* int: use "%d" or "%i" in printf() */
    #define NUMBER2 100U /* unsigned int: use "%u" in printf() */
    #define NUMBER3 100L /* long int: use "%ld" or "%li" in printf() */
    #define NUMBER4 100UL /* unsigned long int: use "%lu" in printf() */
    /* C99 */
    #define NUMBER5 100LL /* long long int: use "%lld" or "%lli" in printf() */
    #define NUMBER6 100ULL /* unsigned long long int: use "%llu" in printf() */
    

    Note: the U and L can also be in lowercase
    Note2: the U can come before or after the L or LL

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

Sidebar

Related Questions

Telephone Manager give me Null phone number while i have use this code -
Can we use whole page design jpg file as css-sprite without slicing?
When you use the file import in drupal 6 it adds a whole lot
I want to use a single font named Algerian across my whole website. So,
The same way i use this to detect when user scolled down the whole
EDIT (the whole question, it was too unclear) I want to use OpenSSL.NET The
True or not: We should always use proper capitalization and never put whole sentences
I like the whole WMI concept, and I could really make use of it
Alright, I have some data that I need to assign an int type identifier
Is it bad practice to use triggers or scripts to maintain data integrity that

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.