Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 2, Problem 21PS
Which of the following identifiers are valid and which are invalid? Explain your answer.
a. num
b. num2
c. 2dNum
d. 2d_num
e. num#2
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
What is the correct code for this question?
Not as previous code :-.
The ABC company has hired you as an intern on the coding team that creates e-commerce applications.You must write a script that asks the user for a value. The value must be used as a whole number in a calculation, even if the user enters a decimal value.You need to write the code to meet the requirements.Which code segment should you use?
totalItems = input(“How many items would you like?”)
totalItems = float(input(“How many items would you like?”))
totalItems = int(input(“How many items would you like?”))
totalItems = str(input(“How many items would you like?”))
Chapter 2 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Ch. 2 - The purpose of a header file, such as stdio.h, is...Ch. 2 - Prob. 2PSCh. 2 - The C standard function that receives data from...Ch. 2 - Which of the following statements about the...Ch. 2 - Which of the following statements about block...Ch. 2 - Prob. 6PSCh. 2 - Which of the following is not a data type?...Ch. 2 - The code that establishes the original value for a...Ch. 2 - Prob. 9PSCh. 2 - Prob. 10PS
Ch. 2 - To print data left justified, you would use a in...Ch. 2 - Prob. 12PSCh. 2 - One of the most common errors for new programmers...Ch. 2 - Which of the following is not a character constant...Ch. 2 - Which of the following is not an integer constant...Ch. 2 - Which of the following is not a floating-point...Ch. 2 - Prob. 17PSCh. 2 - Which of the following is not a valid identifier...Ch. 2 - What is the type of each of the following...Ch. 2 - What is the type of each of the following...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - What is output from the following program...Ch. 2 - Prob. 24PSCh. 2 - Find any errors in the following program....Ch. 2 - Find any errors in the following program....Ch. 2 - Prob. 27PSCh. 2 - Prob. 28PSCh. 2 - Prob. 29PSCh. 2 - Code the variable declarations for each of the...Ch. 2 - Code the variable declarations for each of the...Ch. 2 - Write a statement to print the following line....Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses defined constants for...Ch. 2 - Prob. 36PSCh. 2 - Prob. 37PSCh. 2 - Write a program that prompts the user to enter an...Ch. 2 - Write a C program using printf statements to print...Ch. 2 - Write a program that reads a character, an...Ch. 2 - Write a program that prompts the user to enter...Ch. 2 - Write a program that reads 10 integers and prints...Ch. 2 - Write a program that reads nine integers and...
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
- Prefer Below to code Asap.arrow_forwardThe following code segment has an error. Find the error and suggest a correction.arrow_forwardGiven: int num1, num2, newNum;double x, y;Which of the following assignments are valid? If an assignment is not valid,state the reason.a. num1 = 35;b. newNum = num1 – num2;c. num1 = 5; num2 = 2 + num1; num1 = num2 / 3;d. num1 * num2 = newNum;e. x = 12 * num1 - 15.3;f. num1 * 2 = newNum + num2;g. x / y = x * y;h. num2 = num1 % 2.0;i. newNum = static_cast<int> (x) % 5;j. x = x + y - 5;k. newNum = num1 + static_cast<int> (4.6 / 2);arrow_forward
- 1 1. The following numbers are in the number system B = (one over the cube root of 2) and D= {0,1}. Add the numbers and give the answer in the same number system: 1100010010.110011 + 1010011000.11 0001arrow_forwardSymbolize the following argument and then determine if it is valid or invalid. Everything is physical. Therefore, it is not the case that there is something which isn’t physical.arrow_forwardWhat the differences between: AxB and |AxBarrow_forward
- Complete the code based on the question givenarrow_forwardWhich of the following is a convention in Mathematics? a. Sets b. Fractals c. Digits 0 to 9arrow_forwardWhich is false about data type? Reserved word for integer is int Reserved word for a floating number is double or float Reserved word for character is char Reserved word for number is numarrow_forward
- The client wants pseudocode for calculating students GPA that he believes has bugs in it. Find all logicalerrors in the provided pseudocode and provide the following information in your report:i) The number of logic errors in the provided code.ii) Your client is not a software developer, to help them understand the problem, describe what alogic error is.iii) Which line of code does the logic error occur in.iv) Fix the logic error and provide the fixed code.v) Describe why the code was changed to resolve the logic errorarrow_forwardIs this statement true or false? PYHTHON!! The key values in Dictionaries must be unique.arrow_forwardPick the first four numbers of your index number eg. 0401 if index number is 04011212 i. 45 ii. 654 iii. 545 iv. 665 v. 6565 a. Use your index number as n1=0401 and let n2= 45. Using Fibonacci series, generate the values of n3 up to n10. Do this for i., ii, iv and v. b. Write the c++ code for generating i.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
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
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License