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
IrinaVladis [17]
3 years ago
12

C programming question:

Computers and Technology
1 answer:
denpristay [2]3 years ago
6 0

Answer:

You should do this:

if (0==strcmp(modelName,"Extravagant") && modelYear >= 1999 && modelYear <= 2002)

printf("%s\n","RECALL");

Explanation:

Lets consider this program and analyze the output.

int main()

{

int modelYear;

char modelName[30];

printf("enter the year");

scanf("%d",&modelYear);

printf("enter the modelname");

scanf("%s",modelName);

if (0==strcmp(modelName,"Extravagant") && modelYear >= 1999 && modelYear <= 2002)

printf("%s\n","RECALL");    }

if (0==strcmp(modelName,"Extravagant") && modelYear >= 1999 && modelYear <= 2002)

This statement has a function strcmp  which is used to compare two strings.

If the user enters Extravagant as model name then this input will be compared by the string stored in modelName i.e. Extravagant, character by character. If the string entered by the user matches the string stored in modelName this means this part of the if condition evaluates to true. 0==strcmp means that both the strings should be equal.

The next part of the if statement checks if the model year entered is greater than or equal to 1999 AND less than or equal to 2002. This means that the model year should be between 1999 and 2002 (inclusive).

&& is the logical operator between both the parts of if statement which means that both should evaluate to true in order to display RECALL.

This is correct way to use because the if (modelName == "Extravagant" && modelYear >= 1999 && modelYear <= 2002)  printf("%s\n","RECALL"); statement will not display RECALL. After entering the model name and model year it will move to the next line and exit.

So in if (0==strcmp(modelName,"Extravagant") && modelYear >= 1999 && modelYear <= 2002)

printf("%s\n","RECALL"); statement when the if condition evaluates to true, then RECALL is displayed in the output.

You might be interested in
When a hardware or software interrupt occurs, the CPU calls________
Alja [10]

Answer:

Operating system

Explanation:

An interrupt is the signal sent to the processor that interrupts the current process. It may be generated by a hardware device or a software program.With each interrupt the CPU hardware does exactly the same thing, which is what enables operating systems to take control of the current user operation.

5 0
3 years ago
Under which menu would you be able to see the number of continuous track minutes available on each mounted hard drive at the cur
Crazy boy [7]

Answer:

looooollll

Explanation:

yooooooooo u good

3 0
2 years ago
Which of the following is a special-purpose computer that functions as a component in a larger product?
Dominik [7]

Answer:  

Embedded Computer

Explanation:

  • An embedded computer is designed to perform a certain function and it is a component of a larger system.
  • An embedded computer has a dedicated function within a larger system and is incorporated as a part of a complete system rather than being a stand alone computer.
  • It is a microprocessor, micro controller based real time control system.
  • Its a combination of hardware and software that have a dedicated function to achieve a specific task. The also have peripheral devices for communication purposes.  
  • Digital Camera , ATM, Calculator, Digital Watch , Self-autonomous Vehicles, Security Camera , Washing Machine , Mp3 player, Microwave Oven , Fire Alarm, Smart Phone,Vending Machines, networking hardware like dedicated routers etc are examples of embedded systems.
  • Embedded computers are less expensive to produce, consumes less power, easier to maintain, do not require remote maintenance and easily customizable.

4 0
3 years ago
The command to delete all the files that have filenames that starts with letter c or c and ends with a letter z or z is
dimaraw [331]
The command is : <span>rm [Aa]*[Zz] </span>
4 0
3 years ago
Primary storage is electronic storage connected directly to the CPU. true or false​
Helen [10]

Answer:

I think it's true

Explanation:

I don't know but If I'm wrong tell me?

7 0
2 years ago
Other questions:
  • In Linux Operating System, what file extension is used forexecutable files?
    6·1 answer
  • A user of the wireless network is unable to gain access to the network. The symptoms are:1.) Unable to connect to both internal
    6·1 answer
  • The code segmentif (speed &lt;= 40)cout &lt;&lt; "Too slow";if (speed &gt; 40 &amp;&amp; speed &lt;= 55)cout &lt;&lt; "Good spee
    11·1 answer
  • Identify the layout in which you will be able to view and edit the header and footer
    12·1 answer
  • Translation of a file into a coded format that occupies less space than the original file is called
    15·1 answer
  • When you use information hiding by selecting which properties and methods of a class to make public, you are assured that your d
    14·1 answer
  • What is the first step to apply the line and page breaks options to groups of paragraphs in a Word document?
    10·2 answers
  • How can you stretch or skew an object in paint
    12·2 answers
  • What<br>are<br>the features of secondary storage media​
    13·2 answers
  • Answer the following 8-mark question in your book.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!