Home » C Programming » Functions » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void fun();
    int main()
    {
    void fun(int);
    fun();
    return 0;
    }
    void fun()
    {
    printf("200");
    }
    1. Compilation Error
    2. 200
    3. Runtime Error
    4. Depends on compiler
    5. None of these
Correct Option: A

Compilation Error

main.c: In function ‘main’:
main.c:6:9: error: too few arguments to function ‘fun’
fun();
^~~
main.c:5:14: note: declared here
void fun(int);
^~~
main.c: In function ‘fun’:
main.c:10:5: error: number of arguments doesn’t match prototype
{
^
main.c:5:14: error: prototype declaration
void fun(int);



Your comments will be displayed only after manual approval.