Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int multiply(int p, int q, int r)
    {
    return p * q * r;
    }
    void main()
    {
    int (fun_ptr)(int, int, int);
    fun_ptr = multiply;
    printf("The multiplication of three numbers is : %d",
    fun_ptr(12, 2, 5));
    }
    1. The multiplication of three numbers is : 120
    2. Nothing
    3. Compilation Error
    4. Garbage value
    5. None of these
Correct Option: C

Compilation Error

main.c: In function ‘main’:
main.c:9:17: error: lvalue required as left operand of assignment
fun_ptr = multiply;



Your comments will be displayed only after manual approval.