C
Programming and Technical
Programming
Technical
Function main is the starting point of execution of a program. Which of the following options shall help in making an executable program without the
use of main function in the program?
1. Any function can be made and marked as starting point using a language dependent syntax
2. Two macros can be used. One to hold the name of a function and its working and the other to call the first macro
3. Any program without a main function shall not do anything but can only produce a blank screen
4. It is not possible to run a program without a main function in a program
Read Solution (Total 4)
-
- Ans:2
we can solve this problem by using macros and token-pasting operator - 9 years agoHelpfull: Yes(1) No(3)
- #include
#define begin main
int begin() {
printf("Hello");
return (0);
}
option : 2 - 9 years agoHelpfull: Yes(1) No(0)
- the linker creates start of function.the start of function cals the main and main will execute first in the program. so,without writing main we can create executable file by compiling $cc -nostartfiles filename.c
- 9 years agoHelpfull: Yes(0) No(0)
- 2) is correct that is two macros can be used.One to hold the name of of a function and its working and the other to cal the first macro.
- 6 years agoHelpfull: Yes(0) No(0)
C Other Question