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
What is the name of the technology that is typically implemented on switches to avoid Ethernet connectivity problems when the wr
Andrew [12]

Answer:  Medium Dependent Interface Crossover (MDIX)

Explanation:

The technology that is typically implemented on switches to avoid Ethernet connectivity problems is Medium Dependent Interface Crossover(MDIX) For switches with Auto (MDIX) the connection is configured automatically and a crossover or straight-through cable can be used to connect two switches. When this MDIX interface is connected it corrects the connectivity speed and the cabling for proper device functionality.

4 0
3 years ago
What specific job usually includes the important pre-production step of making the
Nataly [62]

Answer:

B. assistant director

Explanation:

Filmmaking can be defined as the art or process of directing and producing a movie for viewing in cinemas or television. The process of making a movie comprises of five (5) distinct phases and these are;

1. Development.

2. Pre-production.

3. Production.

4. Post-production.

5. Distribution.

An assistant director can be defined as an individual who is primarily saddled with the responsibility of reviewing and making script-breakdown, making daily call sheets of the crew, arranging logistics, and tracking the film production schedule. Also, an assistant director normally functions in the pre-production process of a movie and are expected to work closely with the director and other crew members, so as to understand their requirements or needs.

Hence, an assistant director is a specific job that usually includes the important pre-production step of making the script breakdown.

6 0
3 years ago
Write a Box class whose init method takes three parameters and uses them to initialize the private length, width and height data
lord [1]

Answer:

Answered below

Explanation:

//Program is written in Java programming //language

Class Box{

private double length;

private double width;

private double height;

Box(double len, double wid, double hgt){

length = len;

width = wid;

height = hgt;

}

public double volumeOfBox( ){

double volume = length * width * height;

return volume;

}

public double getLength( ){

return length;

}

public double getWidth( ){

return width;

}

public double getHeight( ){

return height;

}

}

8 0
2 years ago
What are the different types database of end users? Discuss the main activi-ties of each
disa [49]

Answer:

following types of databases available in the market −

Centralised database.

Distributed database.

Personal database.

End-user database.

Commercial database.

NoSQL database.

Operational database.

Relational database.

Cloud database.

Object-oriented database.

Graph database

8 0
2 years ago
Read 2 more answers
For his class project, Matt has to create an image in a color scheme that has shade or tint variations of the same hue. Which co
Alex

Answer:

B.Monochromatic

Explanation:

mono means one

5 0
3 years ago
Other questions:
  • Which answer best describes an unsubsidized federal loan
    9·1 answer
  • Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
    12·1 answer
  • Carol typed a memo to send to everyone in her department. To create this memo, she used a _____. spreadsheet word processor fax
    10·2 answers
  • Match the personality traits with their description
    9·2 answers
  • Which one is correct
    8·1 answer
  • Write an HTML document which contains two text fields, a button, and a div. The first text field should be labeled “Temperature”
    10·1 answer
  • The working window of a presentation is the O outline O handout 0 notes o slide​
    5·2 answers
  • If the algorithm does not have instructions for unanticipated results, the computer program will
    15·1 answer
  • Technical term of stealing personal information in social media.​
    5·1 answer
  • The amount of data that can be stored on a disk depends in part on_____.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!