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
Privacy concerns, financial information, security of your personal data has
Bas_tet [7]

Answer:

Explanation:

Data security is the process of protecting your most critical business assets (your data) against unauthorized or unwanted use.

This not only involves deploying the right data security products, but also combining people and processes with the technology you choose to protect data throughout its lifecycle. Enterprise data protection is a team sport.

Best practices for effective data security include taking a risk-based approach to protecting data, using a unified platform that integrates data security information across your entire enterprise and ensuring scalability across environments of any size across public cloud, on-premises and hybrid cloud deployments.

5 0
4 years ago
Convert the following decimal fraction to binary with a maximum of six places to the right of the binary point: 194.03125Note: n
nika2105 [10]

Answer:

11000010.000010

Explanation:

3 0
4 years ago
How to change the size of my document in cs6?
Aleonysh [2.5K]
When you're saving your image, it will ask you what quality of the image you want to use and it will show you that you're using a larger or smaller filesize depending on the quality of the image your saving.

<TIP>  Make a duplicate layer before saving the image and uncheck the original. Always save the CS6 file too to re-edit later if need be. But that way you will have the file size you want and the original image is preserved
5 0
3 years ago
Markup is BEST defined as:
Finger [1]
The amount of money added to the product by the seller, difference between the cost price and selling price 
6 0
3 years ago
Write convert() method to cast double to int Complete the convert() method that casts the parameter from a double to an integer
alexgriva [62]

Answer:

Write convert() method to cast double to int Complete the convert() method that casts the parameter from a double to an integer and returns the result. Note that the main() method prints out the returned value of the convert() method.

Ex: If the double value is 19.9, then the output is: 19

Ex: If the double value is 3.1, then the output is: 3

Explanation:

<h3>plz bhai mera answer ko brainliest kar do.....</h3>
8 0
3 years ago
Other questions:
  • What is tuple and attribute of a relation​
    11·1 answer
  • What does obsolete mean?
    14·2 answers
  • How do you get stickman worriers
    12·1 answer
  • A system administrator needs to create a high-performance SQL server. What type of disk configuration will allow the administrat
    7·1 answer
  • The Sussex Educational Processor executes an instruction every 3 clock cycles. Explain why that is the case and specifically wha
    12·1 answer
  • Discuss operations of vectors in computer graphics?
    5·1 answer
  • Drag each statement to the correct location.
    10·1 answer
  • Consider the following method, remDups, which is intended to remove duplicate consecutive elements from nums, an ArrayList of in
    7·1 answer
  • Intelligent automation expands on simpler forms of automation through the use of which technology?
    8·1 answer
  • Which factor affects reading speed the most?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!