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
Language modeling incorporates rules of __. Select all that apply.
LUCKY_DIMON [66]

Language modeling incorporates rules of grammar and pronunciation patterns

  • Language modeling  is simply known to use rules of grammar, known pronunciations, and other patterns
  • It seeks to know the given probability distribution of all linguistic units such as words, sentences.  is main work is to predict the next word that is to come in a document.
  • It makes use of grammar principles and the various forms of pronunciation in its task.

Conclusively, we can say that Language modeling incorporates rules of grammar and pronunciation patterns

Learn more from

brainly.com/question/6214562

4 0
3 years ago
The approved systems design document is used by programmers, the personnel department, and information systems personnel.
Crazy boy [7]
True because I have never seen that True or false answer before
5 0
3 years ago
Explain with examples what is software​
zvonat [6]

Answer:

Software is the data in your computer for example apps

Explanation:

Apps are a form of software

8 0
2 years ago
How is the OR (||) logical operator used?<br> PLS HURRY
3241004551 [841]

Answer:

The answer is below

Explanation:

A logical operator is a symbol or word used to connect two or more expressions such that the value of the compound expression produced depends only on that of the original expressions and on the meaning of the operator. Common logical operators include AND, OR, and NOT.

4 0
2 years ago
What are some examples of environmental technology
Zarrin [17]
Some examples of environmental technology is recycling.
3 0
3 years ago
Other questions:
  • Windows Live SkyDrive is an example of _____ storage.
    13·1 answer
  • Which are valid double statements for java? double a = 0; double b = -1.0; double c = -425; double d = 6340; double e = -1.0; do
    12·2 answers
  • Write a paper, 2-3 paragraphs that discuss how to defend ideas objectively through effective communication. Include the skills n
    6·1 answer
  • What is the output of 1101 x 10 == 11000 + 10?
    12·1 answer
  • 4-Translate the following C program to MIPS assembly program (Please explain each instruction in your code by a comment and subm
    6·1 answer
  • 1.Input device which transfers information and images from physical documents to computer files.
    14·1 answer
  • What is online school like 6 sentences
    12·1 answer
  • An ____ is an object that produces each element of a container, such as a linked list, one element at a time.
    13·2 answers
  • Unconformities develop when new sedimentary layers accumulate atop old, eroded layers, resulting in a geologic hiatus. Which of
    9·1 answer
  • when you insert a new column, the existing columns are shifted to the ____ and the new column has the same width as the column d
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!