Ask Question
3 October, 19:09

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. 3 October, 19:34
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers