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]
4 years ago
12

C programming question:

Computers and Technology
1 answer:
denpristay [2]4 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
Negative numbers are encoded using the __________ technique. a. two’s complement b. floating point c. ASCII d. Unicode
OLEGan [10]

Negative numbers are encoded using the two’s complement technique. Two's complement is used to encode negative numbers.

Option  A is correct .

<h3>What method does the in data type use to store negative numbers?</h3>

Most implementations you're likely to encounter store negative signed integers in a form known as two's complement. Another important way of storing negative signed numbers is called one's complement. The one's complement of an N-bit number x is basically defined as x with all bits inverted.

<h3>What is encoding method?</h3>

An encoding technique is the application of established industry conventions to a coded character set to create a coded character scheme. Such rules determine the number of bits required to store the numeric representation of a given character and its code position in the encoding.

Learn more about two complement technique encoding :

brainly.com/question/26668609

#SPJ4

5 0
1 year ago
1. Choose in each case that it affects which of the Information security requirements (confidentiality, integrity, availability)
just olya [345]

The  cases that it affects which of the Information security requirements is explained below.

<h3>What are the Information security violations of the above cases?</h3>

Someone has copied your credit card and CVV number has violated the confidentiality as this is to be known only by the owner for if the cvv is known by another person who is not the owner, it may lead to theft of the owners' funds/money.

If someone sends a message “Please come at 10 AM”, the receiver receives “Please come at 10.” and the person did miss the appointment due to the misinformation, it violates the availability. If one is not understanding a message, it is better to clarify so as to know if one will be available,

If the attacker has deleted the installed copy of the Microsoft Office application from your laptop is integrity/confidentiality. One who has integrity will not attack another's' system.

learn more about confidentiality from

brainly.com/question/863709

6 0
2 years ago
If the user inputs “10” for the first expense and “20” for the second expense, what will the interpreter show in the final line
andriy [413]
Yes :) I totally agree with the person above me ^
7 0
3 years ago
Ashton assigned a string value to a variable. Which program statement should he use?
m_a_m_a [10]

Answer: c because there cant be numbers or simboles also nooooooo spaces

Explanation:

brainlyist plz

6 0
3 years ago
A ______ object is used for displaying the results of a question based on stored data.
Sphinxa [80]
The answer would be C
3 0
3 years ago
Read 2 more answers
Other questions:
  • Game designers use background images to _______ .
    8·1 answer
  • Please help!
    10·2 answers
  • Radio waves pros and cons
    10·2 answers
  • All of the following are typical characteristics of internet predators, except white. male. between the ages of 18 and 35. high
    7·1 answer
  • Unlocking your smart phone remote security protections that protect your mobile device from meniscus applications
    5·1 answer
  • What file in the user account folder stores user settings?
    8·1 answer
  • Which of the following is true of e-learning and computer-based training (CBT)?
    13·1 answer
  • Which statement correctly differentiates how to use list and table styles?
    12·2 answers
  • The sequence of Figures shows a pattern. if the pattern repeats, how many triangles will the figure 5 have ?​
    7·1 answer
  • SOMEONE HELP ME!!!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!