Question: Given the following main program: int main() { int x; int y = 10; int z = 20; x = add(y,z); return 0; } Which
Given the following main program:
int main() { int x; int y = 10; int z = 20; x = add(y,z); return 0; }
Which function is correctly written to store the value in x?
| int add(int a, int b) { return a+b; } | ||
| float add(float a, float b) { float x; x = a + b; return x; } | ||
| void add(int y, int z) { int x; x = y + z; return; } | ||
| int add(y, z) { int x; x = y + z; return x; } |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
