C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 13, Problem 13.5E
Program Plan Intro
- The variable x of type int is used in macro SUM().
- The variable y of type int is used in macro SUM().
- Declare a macro named SUM() with two arguments.
Program description:
The main purpose of the program is to display the sum of two integer numbers using the macro.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(Rounding Numbers) Function floor can be used to round a number to a specific decimal place. The statementy = floor(x * 10 + 0.5) / 10;rounds x to the tenths position (the first position to the right of the decimal point). The statementy = floor(x * 100 + 0.5) / 100;rounds x to the hundredths position (the second position to the right of the decimal point). Write a program that defines fourfunctions to round a number x in various ways:A. roundToInteger(number)B. roundToTenths(number)C. roundToHundredths(number)D. roundToThousandths(number)For each value read, your program should print the original value, the number rounded to the nearest integer, the number rounded to the nearest tenth, the number rounded to the nearest hundredth and the number rounded to the nearest thousandth.
please quickly thanks ! use Python
(Use Python)
The function course_average should calculate and return the average of the three values pass to it.
The function main should ask the user to enter three grades and then pass these values to the course_average function. This function should also display a message to the user in the format below.
For example, if the user entered 100, 90 and 95 the message would be:The average of 100 , 90 and 95 is 95
Chapter 13 Solutions
C How to Program (8th Edition)
Ch. 13 - Prob. 13.4ECh. 13 - Prob. 13.5ECh. 13 - (Smallest of Two Numbers) Write a program that...Ch. 13 - (Smallest of Three Numbers) Write a program that...Ch. 13 - (Printing a String) Write a program that defines...Ch. 13 - (Printing an Array) Write a program that defines...Ch. 13 - (Totaling an Arrays Contents) Write a program that...
Knowledge Booster
Similar questions
- (Intro to Python) Write complete python program that defines and calls a function isEvenNumber which takes one parameter and prints whether the number is even or odd. Prompt the user to enter a number and call the function passing the number as an argument to generate the following output. Zero can be classified as even. Sample output is: Enter a number: -5 -5 is odd number or Enter a number: 12 12 is even numberarrow_forwardCall main and run all of the functions. Not: Write some print functions to see the outputs inside each function. (Python programming language)arrow_forward(Python) Write a function that receives a string containing a 32-bit hexadecimal integer. The functionmust return the string’s integer value.arrow_forward
- (Integers Added Together) Create a program that employs the for statement to sum a succession of integers in a single line. Assume that the first integer read defines the number of values that must be entered before the next one may be read. Your software should only read one value per input statement in order to avoid memory leaks. A typical input sequence may be 5 100 200 300 400 500 (or something like). where the number 5 signifies that the items after it are to be added together.arrow_forward(I use mindtap on cengage, if that not possible, please use devc++ 5.11) Instructions Assume the definition of Exercise 2, which defines the struct computerType. Write a program that declares a variable of type computerType, prompts the user to input data about a computer, and outputs the computer’s data. Example input and output is shown below: Enter the name of the manufacturer: McPC Enter the model of the computer: 1000 Enter processor type: Intel GFX Enter the size of RAM (in GB): 8 Enter the size of hard drive (in GB): 1000 Enter the year the computer was built: 2016 Enter the price: 1200 Manufacturer: McPC Model: 1000 Processor:…arrow_forward(python) Write a program with a user-defined function called 'clamp', which takes as an input a single integer. If the input number is negative, have the function return zero. If the value is postivie and greater than 255, have the function return 255. If the value is between 0 and 255, have the function return the number unaltered. Write a main program section that prompts the user to enter a number, recasts it to an integer, and calls the clamp function. The program should then print out the value returned by the function call.arrow_forward
- (Average a Sequence of Integers) Write a program that calculates and prints the average ofseveral integers. Assume the last value read with scanf is the sentinel 9999. A typical input sequencemight be10 8 11 7 9 9999indicating that the average of all the values preceding 9999 is to be calculatedarrow_forward(Quality Points for Student’s Grades) Write a function toQualityPoints that inputs a student’s average and returns 4 it’s 90–100, 3 if it’s 80–89, 2 if it’s 70–79, 1 if it’s 60–69, and 0 if theaverage is lower than 60arrow_forward: Write a function that adds two numbers. You should not use+ or any arithmeticoperators.arrow_forward
- (PYTHON) Write a program with a function that takes a string; if the length of a string is even, the functionshould add an asterisk at the beginning of a string; else, the function should add asterisks at the end ofa string. The function, then, capitalizes all letters and returns the new string The program should let the user enter a string and pass it to the function.arrow_forward(python) Write a function myfunction that requests user input i the form of an integer value, 1, 2 or 3. The function should print out: Option 1 selected Option 2 selected Option 3 selected when the corresponding number is entered, and the loop should end if q is entered. Any unrecognised options should result in the following statement being printed: Unknown optionarrow_forward3. Write the function to evaluate/compute the following, i.e. the value of Pl given by the algorithm, known as Leibniz: Write code on space provide below the problem. You do not need to Run the code... (Approximate π) can be computed using the following formula: π = 4 x 1 and 4 X 1 - 1 3 + Write a program that displays the result of 4 X 1 1 5 - 1 7 1 3 + 1 9 1 1 1 1 + - 5 7 9 11 - 1 11 + 1 13 1 15 + 1 3 + 1 1 5 7 + 1 9 1arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education