What is the difference b/w main() in C language and main()
in C++.

Answers were Sorted based on User's Feedback



What is the difference b/w main() in C language and main() in C++...

Answer / vignesh1988i

there is no difference between main() in both of the
languages...... in c++ we will see all intrerms of
objects.... thats all......

Is This Answer Correct ?    13 Yes 5 No

What is the difference b/w main() in C language and main() in C++...

Answer / gganesh

In c, main function will execute starting itself.
In c++, main function will execute finally

Is This Answer Correct ?    2 Yes 2 No

What is the difference b/w main() in C language and main() in C++...

Answer / ayush jindal

in c & c++
the main difference is that "c" is based on top to bottom
approach.in "c"languge the header file is used as
#include<stdio.h> its also programable language.

& in c++ is based on bottom upto top approach. in c++ the
header file is used as #include<iostream.h> is used. is
also based on "object oriented program".

Is This Answer Correct ?    4 Yes 5 No

What is the difference b/w main() in C language and main() in C++...

Answer / ayush

there is no difference b/w in c & c++ in main() function.

Is This Answer Correct ?    2 Yes 3 No

What is the difference b/w main() in C language and main() in C++...

Answer / sagarika

In C language , main() does not return any value.
Hence there is no need of return type whereas in c++ main
returns the value. if there is no return type we should
specify it by writing the keyword void before main.

Is This Answer Correct ?    2 Yes 3 No

What is the difference b/w main() in C language and main() in C++...

Answer / ppp

In c:
int main(){ void main(){
..... .......
..... OR ......
return 0; }
}

Is This Answer Correct ?    2 Yes 6 No

What is the difference b/w main() in C language and main() in C++...

Answer / kishan gowda

Ther is a difference b/w c and c++ main()...After execution
of int main() in c it returns zero on null to the operating
system where as in c++ it returns 1 to the O.S.

Ex:
In c:
int main(){ void main(){
..... .......
..... OR ......
return 0; }
}
In C++:

int main(){ int main(){
..... .......
..... OR ......
return 1; }//by default it retruns 1.
}

Is This Answer Correct ?    5 Yes 12 No

Post New Answer

More C Interview Questions

2. What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value

3 Answers   Accenture,


how to calculate the time complexity of a given algorithm? pls give exaples..mainly for the coplexities such as O(log n),O(n log n)...

1 Answers   Infosys,


Why c++ is called c++ and not c+?

9 Answers   EBS,


what is the function of pragma directive in c?

0 Answers  


What is main () in c?

0 Answers  






What is that continue statement??

4 Answers  


Explain what is the benefit of using an enum rather than a #define constant?

0 Answers  


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

0 Answers  


What is #line used for?

0 Answers  


If input is 123 then how to print 100 and 20 and 3 seperately?

4 Answers  


What is the difference between array and linked list in c?

0 Answers  


Why is C language being considered a middle level language?

0 Answers  


Categories