Page 1 of 1

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

Posted: Wed Apr 27, 2022 3:08 pm
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 33 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;