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
I need a explanation for this 02 question for a test I will have .
In-s [12.5K]
23. C

24. A

Medal me Plz!!
7 0
3 years ago
All of the Internet in your country disappears. What happens next?
Talja [164]

Answer:

It is most likely that in a tech surrounded environment there would be an apacolypse, not necessarily a man hunting man apacolypse but it would cause a huge panic throughout that country because government could not communicate which is what leaves people with a safeplace.

Explanation:

please mark as brainliest xx hope it helps <3

if you really like this topic watch into the forest on netflix, it has the same premise except its not that internet disappears its electricity.

4 0
3 years ago
How many digits are in the binary number system? Explain why.
Katen [24]

Answer:

Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication: If the digit in B is 0, the partial product is also 0. If the digit in B is 1, the partial product is equal to A.

Explanation:

8 0
3 years ago
Read 2 more answers
ISO 400 is twice as sensitive and ISO 100 true or false
beks73 [17]

Answer:

Quite simply, when you double your ISO speed, you are doubling the brightness of the photo. So, a photo at ISO 400 will be twice brighter than ISO 200, which will be twice brighter than ISO 100.

Explanation:

ISO most often starts at the value of ISO 100. This is the lowest, darkest setting, also called the base ISO. The next full stop, ISO 200, is twice as bright, and ISO 400 is twice as bright than that. Thus, there are two stops between ISO 100 and 400, four stops between 100 and 1600, and so on.

4 0
3 years ago
Why might location be important when searching for a job?
Elan Coil [88]
D I think because none of the others seem like very important things, 
8 0
3 years ago
Read 2 more answers
Other questions:
  • Which elements in a web page require a visitor’s action?
    15·1 answer
  • Question 14. (3.04 MC) how does the project manager evaluate the scope of a project
    14·1 answer
  • Which file type is typically used for videos? GIF MPEG MP3 PDF
    8·1 answer
  • Julie is trying to decide weather or not to add a color scheme to her presentation and she asks you for your advice u should adv
    9·1 answer
  • What will happen when you drag and drop a worksheet tab into another workbook WITHOUT holding the Ctrl key down?
    13·2 answers
  • Write two example use of relationships ICT
    11·1 answer
  • 3.6 Code Practice Edhesive. (PYTHON LANGUAGE)
    13·1 answer
  • Does anyone know what episode Hinata threatens useless sakura?
    9·1 answer
  • Describe some things that this person might say that might cause you to NOT hire them. Explain.
    6·1 answer
  • A word or phrase to help identify a file when you do not know the file name during the file expiration search
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!