Is main() function predfined or userdefined?
Answers were Sorted based on User's Feedback
Answer / nara venkata satyanarayana
First we should know whether main() belongs to C/C++ or
java. If it is in C/C++ it is "user-defined" because not
available in any header file and body defined by user, but
compiler will starts body execution from main() function
only. But in java without main() also we can execute
programs and get output eg:-using static blocks.
Here also it is "user-defined" one.
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / sreehari
main() function is user-defined function. Before knowing the
reason, we should know one thing is we can use predefined
function and get the result but we never write code for
predefined functions explicitly na....and we use to write
the code of main function for our desires.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / gunda rajkumar
"userdefined" because we are writing the code for main()
or we are defining the boby for main()
| Is This Answer Correct ? | 8 Yes | 3 No |
Answer / subodh sharma
The main function is predefine and have three arguments
which return the value to the operating system and main is
also called by operating system .
| Is This Answer Correct ? | 11 Yes | 9 No |
Answer / mohit jain
main() function is user defined function becoz we defined it.
it is not predfined in header files.
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / aditya reja
main() is a user define function because its definition
is always define by user and its definition is not present in
any header file.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vignesh1988i
it is a predefined function..............
| Is This Answer Correct ? | 8 Yes | 15 No |
If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i give int a[5] = {5}; then 5 0 0 0 0 is ans. what will I do for all element 5 5 5 5 5 in a single statement???
what is difference between array and structure?
44 Answers College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,
How do shell structures work?
How does the assert() function work?
how can make variable not in registers
Can a local variable be volatile in c?
What is meant by recursion?
#include<stdio.h> int main(){ int a[]={1,2,3,5,1}; int *ptr=a+4; int y=ptr-a; printf("%d",y); }
say the following declaration is correct nr not. int b=a,n=0;
How to receive strings with spaces in scanf()
Combinations of fibanocci prime series
Write a program to print all the prime numbers with in the given range
8 Answers ABC, College School Exams Tests, TCS,