Split Assignment Two Cpp Files One Main Function Two Functions Write Function Accepts Two Q37102902

Split your assignment into two cpp files: one should have themain function, and the other should have two other functions.

Write a function that accepts two integers as input argumentsand return their sum. Call this function from main( ) and callanother function from main( ) that prints the result (sum). Thus,you need two separate functions besides main( ).

Upload two files for this assignment. ALSO UPLOAD SCREENSHOT OFYOUR IDE (e.g. Visual Studio) SHOWING YOUR PROJECT CONTAINS TWOCODE FILES.


Answer


#include <iostream>using namespace std;int sum(int a, int b){ return a+b;}int main (){ int a, b;

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.