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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!