Ask Question
8 January, 04:20

Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 1970, print "Probably has head rests.". If after 1991, print "Probably has electronic stability control.". If after 2002, print "Probably has airbags.". End each phrase with period and newline. Ex: carYear = 1995 prints: Probably has head rests. Probably has electronic stability control.

+4
Answers (1)
  1. 8 January, 07:35
    0
    Following is the statement in the C language:

    if (carYear < 1968)

    printf ("/nProbably has a few safety features./n");

    if (carYear > 1970 && carYear <=1991)

    printf ("/nProbably has head rests./n");

    if (carYear > 1991 && carYear <=2002)

    printf ("/nProbably has anti-lock brakes/n.");

    if (carYear > 2002)

    printf ("/nProbably has airbags./n");

    Explanation:

    Following is the description of the statement:

    In the given question we used if block. The if block is only executed when their condition is true. if (carYear <1968) In this we check we the value of "carYear" variable is less then 1968 then it prints "Probably has a few safety features." in the console window. if (carYear> 1970 && carYear 1991 && carYear <) In this we check we the value of "carYear" variable is greater then 1991 and less then 2003 it prints "Probably has anti-lock brakes" in the console window. if (carYear> 2002) In this we check we the value of "carYear" variable is greater then 2002 then it prints "Probably has airbags" in the console window.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 1970, print ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers