102k views
2 votes
Write a C program that has the following statements: int a, b; a = 10; b = a + fun(); printf("With the function call on the right, ");

1 Answer

5 votes

Answer:Following is the C program:-

#include <stdio.h>

int fun()//function fun of return type int and it returns value 6.

{

return 6;

}

int main() {

int a, b;

a = 10;

b = a + fun();//adds 6 to a.

printf("With the function call on the right, ");

printf("\\%d ",b);//printing b..

return 0;

}

Output:-

With the function call on the right,

16

Step-by-step explanation:

The function fun return the value 6 so it adds 6 to a and stores the result in b.

User Lance Harper
by
5.4k points