C Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9780357238547
Author: D. S. Malik
Publisher: Cengage Limited
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
thumb_up100%
Chapter 2, Problem 2MC
Program Description Answer
Identifiers must begin with letters or underscore and consist of letters, digits, or underscores
Hence, the valid identifiers are options "b", "d", "e", "f".
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
C++ Language code and explain
Zodiac Sign Identifier - Ask the user's birth month and birth day and return the corresponding Zodiac Sign he/she belongs: Evaluate the user's birth month and day by checking the following: If born from,
Mar 21 to Apr 19 - Aries
Apr 20 to May 20 - Taurus
May 21 to Jun 20 - Gemini
Jun 21 to Jul 22 - Cancer
Jul 23 to Aug 22 - Leo
Aug 23 to Sep 22 - Virgo
Sep 23 to Oct 22 - Libra
Oct 23 to Nov 21 - Scorpio
Nov 22 to Dec 21 - Sagittarius
Dec 22 to Jan 19 - Capricorn
Jan 20 to Feb 18 - Aquarius
Feb 19 to Mar 20 - Pisces
Example:
What is your month of birth? 1 - January (31 days) 2 - February (27 days, if Leap Year 28 days) 3 - March (31 days) 4 - April (30 days) 5 - May (31 days) 6 - June (30 days) 7 - July (31 days) 8 - August (31 days) 9 - September (30 days) 10 - October (31 days) 11 - November (30 days) 12 - December (31 days)
Please enter your birth month: 8
Please enter day of your birth: 16
Please enter your year of birth: 1997
Your birthday is every…
All of the following C identifiers are valid EXCEPT:
А.
answer10_scheme
В.
_answer_scheme
С.
O.
answer-scheme99
D.
answerscheME99
E.
answer_scheme_by_me99
Which of the following is NOT a logical operator in C++ language?
O!
O &
O &&
Previous
Chapter 2 Solutions
C Programming: From Problem Analysis to Program Design
Ch. 2 - 1. Mark the following statements as true or...Ch. 2 - Prob. 2MCCh. 2 - Which of the following is not a reserved word in...Ch. 2 - Prob. 4SACh. 2 - 5. Are the identifiers quizNo1 and quiznol the...Ch. 2 - 6. Evaluate the following expressions. (3,...Ch. 2 - If int x = 10;, int y = 7;, double z = 4.5;, and...Ch. 2 - Prob. 8CPCh. 2 - 9. Suppose that x, y, z, and w are int variables....Ch. 2 - Prob. 10SA
Ch. 2 - Which of the following are valid C++ assignment...Ch. 2 - Write C++ statements that accomplish the...Ch. 2 - Write each of the following as a C++ expression....Ch. 2 - Prob. 14SACh. 2 - Suppose x, y, and z are int variables and wandt...Ch. 2 - 16. Suppose x, y, and z are int variables and x =...Ch. 2 - Suppose a and b are int variables, c is a double...Ch. 2 - 18. Write C++ statements that accomplish the...Ch. 2 - Which of the following are correct C++ statements?...Ch. 2 - Give meaningful identifiers for the following...Ch. 2 - 21. Write C++ statements to do the following....Ch. 2 - Prob. 22SACh. 2 - The following program has syntax errors. Correct...Ch. 2 - Prob. 24SACh. 2 - Prob. 25SACh. 2 - Preprocessor directives begin with which of the...Ch. 2 - 27. Write equivalent compound statements if...Ch. 2 - 28. Write the following compound statements as...Ch. 2 - 29. Suppose a, b, and c are int variables and a =...Ch. 2 - Suppose a, b, and sum are int variables and c is a...Ch. 2 - Prob. 31SACh. 2 - Prob. 32SACh. 2 - Prob. 33SACh. 2 - Prob. 34SACh. 2 - 1. Write a program that produces the following...Ch. 2 - Prob. 2PECh. 2 - Prob. 3PECh. 2 - 4. Repeat Programming Exercise 3 by declaring...Ch. 2 - Prob. 5PECh. 2 - Prob. 6PECh. 2 - 7. Write a program that prompts the user to input...Ch. 2 - Prob. 8PECh. 2 - 9. Write a program that prompts the user to enter...Ch. 2 - 10. Write a program that prompts the user to input...Ch. 2 - 11. Write a program that prompts the capacity, in...Ch. 2 - 12. Write a C++ program that prompts the user to...Ch. 2 - 13. To make a profit, a local store marks up the...Ch. 2 - 14. (Hard drive storage capacity) If you buy a 40...Ch. 2 - 15. Write a program to implement and test the...Ch. 2 - 16. A milk carton can hold 3.78 liters of milk....Ch. 2 - 17. Redo Programming Exercise 16 so that the user...Ch. 2 - Prob. 18PECh. 2 - 19. Write a program that prompts the user to input...Ch. 2 - 20. For each used car a salesperson sells, the...Ch. 2 - 21. Newton's law states that the force, , between...Ch. 2 - 22. One metric ton is approximately 2,205 pounds....Ch. 2 - 23. Cindy uses the services of a brokerage firm to...Ch. 2 - 24. A piece of wire is to be bent in the form of a...Ch. 2 - 25. Repeat Programming Exercise 24, but the wire...Ch. 2 - 26. A room has one door, two windows, and a...Ch. 2 - Prob. 27PECh. 2 - 28. In an elementary school, a mixture of equal...Ch. 2 - 29. A contractor orders, say, 30 cubic yards of...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- in C++, the definition of any variable (e.g. int x;) tells the compiler about ________. all of the above the variable's name and its value the variable's name the type of data a variable will hold the variable's data type and its valuearrow_forwardPlease use C# for this. Thank you soo much!arrow_forwardIndicate whether each of the following C# programming language identifiers is legal or illegal. If it is legal, indicate whether it is a conventional identifier for a class. electricBill ElectricBill Electric bill Static void #ssn Ay56we Theater_Tickets 212AreaCode heightInCentimeters Zip23891 Voidarrow_forward
- can you please help me solve this program using C++ language, please try to solve it as simply as possible because the no. of lines don't matter in the religion of concept-grabbing & also enter comments for better understanding. thank youarrow_forwardWhich of the following are valid C++ identifiers? Select whether theyare valid or invalid from the drop-down list. If it is invalid, explain why.1. firstC++Prog2. 3feetInAYard3. CPP_Assignment4. Monthly Pay5. First#6. travel_Time7. _Number8. InchesInOneCentimeter9. Jack’sHomework10. BonusAmount$arrow_forwardq1 part c need code in c++ visual studio Pre-increment the variable x by 1, then add it from the variable total.arrow_forward
- Needs to be done in C# language. Problem Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: • The number of days spent in the hospital• The daily rate• Hospital medication charges• Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.arrow_forwardWhich of the following is a correct identifier in C++? i) VAR_1234 ii) $var_name iii) 7VARNAME iv) 7var_namearrow_forwardFollowing code in C using random Name Reg no and highschool name Use switch case in C language to do the following: Create a restaurant with the name “Your Name - Reg_No – Name of your highschool” The restaurant should come with the options of delivery and take away and the choice should be displayed as “Delivery – Registration No” and “Takeaway – Name” Each option should have the same menu and an extra 15% charge be included if a customer wants home delivery Both menus should have two items that are customizable, such as a burger can have chillies removed, cheese added and extra mayonnaise. The user should have the option of choosing multiple items with multiple quantity. Print a bill in the end.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage