Question 4 (15 marks) a) Write a program that performs arithmetic addition. The program will use two integer variables,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Question 4 (15 marks) a) Write a program that performs arithmetic addition. The program will use two integer variables,

Post by answerhappygod »

Question 4 15 Marks A Write A Program That Performs Arithmetic Addition The Program Will Use Two Integer Variables 1
Question 4 15 Marks A Write A Program That Performs Arithmetic Addition The Program Will Use Two Integer Variables 1 (100.9 KiB) Viewed 31 times
Please try to answer all parts please
Urgent help please I only have 1 hours to complete this write the answer clearly.
*REMINDER!!*
use handwriting only. And cannot run any code in devC++.
Question 4 (15 marks) a) Write a program that performs arithmetic addition. The program will use two integer variables, a and b (obtained by the user) and will perform the addition a+b, store the result in another integer c and show the result of the addition using cout. (5 marks) Sample run: Enter two numbers: 3 12 The sum is 15 b) In the C++ language, there's a precise distinction made between a declaration of a function and a definition of a function. Briefly describe the distinction. (4 Marks) c) In general format, function definition has two parts. Explain. (2 marks) d) Find the value of p. (4 marks) Equations Write answer here float m, n, p; m = 5.1; n = 7.42; //m = n; n = m; p = n; int x, y, p; X = 3; y = 7; p = 9; if (x > y) if (x - y ==4) p = 33; else p = 77; int a, b, p; a = 1; b = 4; while (a < b) { a = 2*a; b = b+1; } p = b; int addition (int a, int b) { int r; r=a+b; return ri } int main() { int p; p = addition (5,3); cout << "The result is " << p; return 0;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply