in Programming in C
670 views
1 vote
1 vote

#include<stdio.h>
main ( )
{
   int new ( );
    new ( );
    (*new) ( );
}

int new ( )

    printf (“Welcome”);
}

}

  1.   prints Welcome Welcome
  2.   prints Welcome
  3.   results in a run-time error
  4.  results in a compilation error
in Programming in C
670 views

8 Comments

prototype define before function call for early compiler
0
0
Is it option 4?
0
0
given ans is 1
0
0
compile time error?

you must define function prior to main function.
0
0

#include<stdio.h>
main ( )
{
   int new ( );
    new ( );
    (*new) ( );
}

int new ( )

    printf (“Welcome”);
}

( Marks: -0.66 )

  1.   prints Welcome Welcome
  2.   results in a compilation error...............................my ans
0
0
someone please give a proper solution?
0
0

int new ( ); :-    behave as function prototype.
    new ( );    :-  function calling

(*new) ( );   :- function calling ......welcome welcome

P:- doesn't require function prototype before main every time...it is required only if function return type in not int.....

0
0
(*new) ( ) @hs_yadav can you explain it more how it can be a function calling.
0
0

Please log in or register to answer this question.