What is the output of this code having void return-type function? void foo() { return 1; } void main() { int x = 0; x = foo(); printf("%d", x); }

Question:
What is the output of this code having void return-type function?

     void foo()
    {
        return 1;
    }

    void main()
    {
        int x = 0;
        x = foo();
        printf("%d", x);
     }

1.1

2.2

3.Runtime error

4.Compile time error

Posted Date:-2022-03-20 12:11:02


More MCQS Questions and answers

Search
Olete Team
Online Exam Test Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Test website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!