1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tasya [4]
3 years ago
9

Write a program to test the difference between %d and %i conversion

Computers and Technology
1 answer:
Gelneren [198K]3 years ago
7 0
Void test(char *s)
{
  int i, d;
  sscanf(s, "%i", &i);
  printf("%s converts to %i using %%i\n", s, i);
  sscanf(s, "%d", &d);
  printf("%s converts to %d using %%d\n", s, d);
}

int main()
{
  test("123");
  test("0x123");
  return 0;
}

outputs:
123 converts to 123 using %i
123 converts to 123 using %d
0x123 converts to 291 using %i
0x123 converts to 0 using %d

As you can see, %i is capable of parsing hexadecimal, whereas %d is not. For printf they're the same.
You might be interested in
All of the following are career pathways in the architecture and construction career cluster except
max2010maxim [7]

Below, I believe are the multiple choices attached to this question

A. Power, Structural, and Technical Systems.

B. Construction.

C. Design/ Pre-Construction.

D. Maintenance/ Operations

The answer is A. Power, Structural, and Technical Systems.

The career pathways in the Architecture and Construction deal with all aspects of designing, planning, maintaining all kinds of structures we live or work in. It is organized into 3 career pathways; Construction, Design/ Pre-Construction, and Maintenance/ Operations. This field also covers the servicing of equipment such as plumbing, electrical wiring, escalators, and elevators.

3 0
3 years ago
Read 2 more answers
Explain why Austin takes close-up pictures of whales and displays them in life-size? worth 50 points
Gre4nikov [31]

The reason why Austin takes close - up pictures of and displays them in life - size is due to the fact that  he wants to give viewers an indelible view or opinion of what a whale is.

  • It also to give whales a background to bring out unexplored thought and emotion in a lot of ways that has been yet to pursued .

<h3>What are Whales?</h3>

This is known to be Animals that are said to be mostly distributed and have a lot of group of aquatic placental marine mammals.

They are known to belong to an informal grouping as they belong to the order Cetartiodactyla.

Learn more about pictures from

brainly.com/question/25938417

5 0
3 years ago
Which one of the following devices would you choose to meet those requirements?
tensa zangetsu [6.8K]
What are the requirements
5 0
2 years ago
Read 2 more answers
If i had apple and microsoft both on my computer and they both fight what would i do
riadik2000 [5.3K]

Answer:

ok

Explanation:

5 0
3 years ago
Read 2 more answers
Explain how the use of the internet has allowed people to achieve some
zubka84 [21]

I don't know if this is going to help you or not because I'm only 13 but let me know if it helps people can now talk to one another more effectively because of things like zoom and it's become more efficient to work at home because we can have online meetings

5 0
3 years ago
Other questions:
  • Adam, a college student, downloads a document containing resume templates from the Internet. When he opens the document
    13·1 answer
  • What is the name for the warmth or coolness of white light?
    10·1 answer
  • Within an organization, a(n) ____ is a group of individuals who are united by shared interests or values and who have a common g
    10·1 answer
  • Network administrators use _______ technology to get antivirus updates to be automatically downloaded on employees' workstations
    15·1 answer
  • A look to different section of the same page is known as_____.
    7·1 answer
  • Inserting and deleting text is a basic editing task in word processing.<br><br> True or false
    6·2 answers
  • 1. Using a microphone to create an audio file to accompany a message is an example of how data is processed and sent to an outpu
    9·1 answer
  • Can somebody please help me with these few questions?
    11·1 answer
  • Help me with this two questions please
    15·1 answer
  • Sebastian reads an online health news article that summarizes a new
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!