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
The value that decides whether something falls into one category or another is called a ____
alexandr402 [8]

Dichotomous variables

Explanation:

A variable is any characteristics, number, or quantity that can be measured or counted. A variable may also be called a data item.

3 0
3 years ago
If your organization hires a new employee, what would you do to create a user account in the Linux system and add the account to
Y_Kistochka [10]

Creating users:

We will use the useradd command to achieve this. Using that same command, you can create users who would log in or customers who would log in (in the case of creating a user for a software installation).

In its basic form, the command is as follows:

  • [Options] useradd username

Take this user olivia, for instance. Assuming that you had been to issue the command prompt:

  • olivia has become a user.

Users are added to the system without the need for a home directory and are unable to log on. It if we were using this rather than running the command without arguments?

  • sudo using useradd -m olivia

Using the command above, a new user would be created, including a home directory that corresponded to the username. That means that you might now see the name "olivia" in the directory "/home".

But what about the lockout concern that was raised earlier? Both these methods are possible. After creating the user, you can enter the following command:

  • Password for olivia is: sudo passwd olivia

You'll be requested to enter & verify your new password once you've completed the process. This unlocks the user profile, allowing them to log in.

This command might look like if you wanted to accomplish it in one go:

  • sudo useradd -m olivia -p PASSWORD

You should be using Passcodes as the login for the user olivia.

As soon as the user logs in, he or she can update their account password by using the password command to input their current password, and afterward entering/verifying their new one.

To create a user that has no personal account and cannot log in, execute the following instructions:

  • sudo use useradd as  the-M USERNAME 
  • ​sudo use usermod as the -L USERNAME

The user to be added is identified by USERNAME.

It establishes a user with really no root folder and prevents them from signing in with a second operation.

To add an existing user to a group on Linux, follow the instructions:

  • As root, log in to your account
  • Use the useradd instruction to add a new user (for example, useradd roman)
  • If you'd like to log on as a new customer, type su plus that user's name.
  • Entering the word "exit" will logout you from your account.

Another way to add a user to a group under Linux would be to use the following syntax:

  • Alternatively, you can use the usermod command.
  • The name of the club should be substituted for example group in this sentence.
  • Example username should be replaced with the name of the user you'd like added.

The following operations are performed when a new login is added to the system.

  • The user's home directory (/home/username by default) is now created.
  • To set configuration files for the user's session, the following secret files are copied into another user's home directory.

.bash_logout

.bash_profile

.bashrc

  • /var/spool/mail/username includes the user's mail spool.
  • The new user account is arranged in groups with the same name.

Learn more:

Linux system: brainly.com/question/13843535

7 0
4 years ago
You have no control over who views your social network information
AleksAgata [21]
Of course you have control, it's private and not access able to anyone else. But Social Network itself can control your info.
3 0
4 years ago
Read 2 more answers
Which of the following is an example of machine learning?
babymother [125]

Answer: auto correct

Explanation: The iPhone can determine what you are going to type because of your past history.

8 0
2 years ago
Best free vpn to bypass geo tagging
Mamont248 [21]

Answer:

Nord VPN

Explanation:

5 0
4 years ago
Other questions:
  • Why will the standard replacement algorithms (LRU, FIFO, clock) not be effective in handling this workload for a page allocation
    11·1 answer
  • Melissa is visiting a Web page that her co-workers frequently update throughout the day. If she wants o make sure she has the mo
    11·1 answer
  • What benefit does internet have​
    11·1 answer
  • Is a set of standards that define how email is to be processed between mail servers is exactly the same as smtp copies an e-mail
    10·1 answer
  • Jemima is reviewing her history report and notices that her headings are not formatted the same throughout the report. She wants
    5·2 answers
  • An___ is a rectangular work area in the desk top that contains a program, text, files, it other data and tools.
    5·1 answer
  • Which of the following is optional equipment on a basic life support​ ambulance? A. Lubricating jelly B. Flashlights C. Disinfec
    11·1 answer
  • Identify an advantage of the software as a service (SaaS) approach in public cloud computing. Group of answer choices The user h
    5·1 answer
  • Print a test page what is the answer.​
    9·2 answers
  • Discuss the information justify with two examples<br>​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!