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
Your company has 1,000 users in a Microsoft Office 365 subscription. A Power BI administrator named Admin1 creates 20 dashboards
AysviL [449]

Answer:

Yes, it is.

Explanation:

Yes it will surely achieve the goal. When there is no license for user, then he/she will not access the dashboard.

7 0
2 years ago
List the invoice number and invoice date for each invoice that was created for James Gonzalez but that does not contain an invoi
Ludmilka [50]

Answer:

Derive FROM invoice_transaction, invoice_details, item_details

and JOIN customer_details  ON (invoice_transaction.CUST_ID = customer_details.CUST_ID  AND customer_details.FIRST_NAME = 'James'   AND customer_details.LAST_NAME  = 'Gonzalez')

Explanation:

The following details will be there in the invoice

  1. item_details
  2. rep_details
  3. invoice_details
  4. customer_details
  5. invoice_transaction

 Derive FROM invoice_transaction, invoice_details, item_details

and JOIN customer_details  ON (invoice_transaction.CUST_ID = customer_details.CUST_ID  AND customer_details.FIRST_NAME = 'James'   AND customer_details.LAST_NAME  = 'Gonzalez')

6 0
2 years ago
Jamal likes the theme he has chosen, but he wants to make his presentation more interesting before he saves it. Which command gr
icang [17]

Answer: Variants

Customize

Explanation:

4 0
3 years ago
Read 2 more answers
The critical path in a project network is:______ A. The Shortest path through the network. B. Longest path through the network.
Softa [21]

Answer:

B

Explanation:

4 0
3 years ago
A variable definition defines the name of a variable that will be used in a program, as well as:
tresset_1 [31]

Answer:

A) The type of data it will hold

Explanation:

In most programming languages, a variable must be decalared before it can be used. Variable declarations allows the compiller to make provision of memory space for the variable so the type of data must be defined accordingly with the name of the variable because different data types occuppy different spaces in memory for example

An integer is 32 bit integral value

A char  is 16 bit unicode value

A double is 64 bit floating point value

6 0
2 years ago
Other questions:
  • Zoom Vacuum, a family-owned manufacturer of high-end vacuums, has grown exponentially over the last few years. However, the comp
    11·1 answer
  • One of the earlier applications of crypto-graphic hash functions was the storage of passwords to authenticate usersin computer s
    13·1 answer
  • loop Write a program to read a list of exam scores given as integer percentages in the range 0 to 100. Display the total number
    5·1 answer
  • Which language is the most popular language for writing apple os x?
    9·1 answer
  • What does this image represent?
    9·2 answers
  • You are troubleshooting a mobile device that will not pair with a Bluetooth headset. The device was functioning properly with th
    7·1 answer
  • What type of waves in the electromagnetic spectrum has the Search for Extraterrestrial Intelligence (SETI) mostly analyzed in th
    15·1 answer
  • A person is trying to remember a list of 12 different items:
    6·2 answers
  • Please help me very important
    7·1 answer
  • Any anime weebs wanna talk
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!