7 comments
#include <iostream> using namespace std; void sum() { int a, b, s; cin >> a >> b; s = a + b; cout << s; } int main() { sum(); }
Also why does this function return a value?
for example, a = 45 and b = 45
I get the sum as 90
0 0 Replyint main() will return 0 if you don't have a return statement
0 0 Replyyes but sum() gives the value 90 in the main function. Why is that?
0 0 Reply
7 comments
Scroll to top