Ask Question

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, ");

+3
Answers (1)
  1. 1 March, 03:10
    0
    Answer:Following is the C program:-

    #include

    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 ("/n%d ", b); //printing b ...

    return 0;

    }

    Output:-

    With the function call on the right,

    16

    Explanation:

    The function fun return the value 6 so it adds 6 to a and stores the result in b.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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, "); ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers