Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is missing in the following C program? #include void main() {int x, y, z; x

ID: 3779300 • Letter: W

Question

What is missing in the following C program? #include void main() {int x, y, z; x = 2; y = 3; z = add(x, y); printf("Addition is %d", z);} int add(int a, int b) {int c; c = a + b; return c;} (a) Function Prototype (b) Function Call (c) Function Definition (d) None What is wrong in the following C program? #include void add(int, int); void main() {int x, y, z; x = 2; y = 3; z = add(x, y); printf("Addition is %d", z);} int add(int a, int b) {int c; c = a + b; return c;} (a) Function Call is wrong (b) Function Return Type (c) Function Prototype (d) None

Explanation / Answer

4) need to declare funtion prototype

#include<stdio.h>
int add(int,int);
void main(){
   int x,y,z;
   x=2;y=3;
   z=add(x,y);
   printf("Addition is %d",z);
}
int add(int a, int b){
   int c;
   c=a+b;
   return c;
}

**************

5) function return type is different because function type declared as void but returning int and catching int

#include<stdio.h>
void add(int,int);
void main(){
   int x,y,z;
   x=2;y=3;
   z=add(x,y);// here is the error return void but catching int
   printf("Addition is %d",z);
}
void add(int a, int b){
   int c;
   c=a+b;
   return c;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote