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
Roman has painstakingly developed the animation for one of the objects on his slide. He can now use the Animation Painter to cop
tigry1 [53]
I think the answer is True
5 0
4 years ago
Hey can you help we with this thanks
dimulka [17.4K]
Hey, it's easy, come on!
6 0
3 years ago
a program p takes time proportional to log where nlogn is the input size. if the program takes 100 ms to process input of size 1
Eddi Din [679]

Answer:

The time is 4 \times 10^7 \ microseconds.

Explanation:

\ The \ requires \ time \ be \ t \ microseconds, \\\\\ \ formula: \\\\ time \propto \ nlog_n \Rightarrow \ time \ = \ knlogn \\\\

\ 10 \ = \ 100 \ log(100) \ \ \ \ \ \ \ \ \ k= 10^2 \ log\ ( \ 10^2\ ) \ k\\\\t=100,000,000 \log \ ( \ 100,000,000\ ) \ k = \ 10^8 \ log\ (\ 10^8\ )\ k \\\\\rightarrow \frac{t}{10} \ =\frac{10^8\ log \ (10^8)k}{10^2\ log\(10^2\ ) k} \\\\\rightarrow \frac{t}{10} \ =\frac{10^8\ log \ (10)\times 8 \times k}{10^2\ log\(10) \times 2 k} \\\\\rightarrow \frac{t}{10} \ =\ 4\times 10^6\\\\\rightarrow \ t \ =\ 4\times 10^6 \times 10 \\\\\rightarrow \ t \ =\ 4\times 10^7 \ microseconds \\\\

3 0
4 years ago
Using web-safe fonts and colors is something you can do to increase blank
Lostsunrise [7]

Using web-safe fonts and colors is something you can do to increase user experience and reliability when creating a web app by ensuring compatibility.

<h3>What are web-safe fonts and colors?</h3>
  • Fonts and colors are considered web-safe when they are included in the basic installation of web browsers.
  • What this means is that these fonts and colors come preinstalled in browsers.
  • This ensured compatibility leads to increased reliability.
  • Having a reliable web app improves user experience and makes for a more successful application.

Therefore, given that web-safe fonts and colors are just those that come preinstalled in most web browsers, using these during the development of your web app will ensure that most users will not have any issues. This increases reliability and improves the user experience.

To learn more about web fonts visit:

brainly.com/question/14450275?referrer=searchResults

7 0
3 years ago
Which of these can be considered data?<br> A:facts<br> B:information<br> C:belief<br> D:all of these
IceJOKER [234]

A) facts.

Facts is the only thing that can be considered REAL data.

6 0
3 years ago
Other questions:
  • Extend the flow properties and definitions to the multiple-source, multiple- sink problem. Show that any flow in a multiple-sour
    13·1 answer
  • Suppose your friend, who is a small business owner, wants to computerize her business functions such as accounting, payroll, and
    7·1 answer
  • which of the following is not a windows accessory? a. sticky notes b. windows 8 c. sound recorder or d. paint
    8·2 answers
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • What is one advantage of inserting a page number field in your document instead of inserting the actual page number?
    14·1 answer
  • which internet technology allows businesses to make presentation and share visual aids such as charts and graphs
    14·2 answers
  • What is hardware?
    10·1 answer
  • What is the best definition of a network?
    14·2 answers
  • Mai lee wants to add a graphic demonstrating a process in her document. which of the following commands should she click in the
    5·1 answer
  • Anyone here good with Alice? I need help ASAP
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!