ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
What is the difference b/w main() in C language and main()
in C++.
 Question Submitted By :: Sivavendra
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference b/w main() in C language and main() in C++.
Answer
# 1
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 ?    7 Yes 3 No
Vignesh1988i
 
  Re: What is the difference b/w main() in C language and main() in C++.
Answer
# 2
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 ?    2 Yes 6 No
Kishan Gowda
 
 
 
  Re: What is the difference b/w main() in C language and main() in C++.
Answer
# 3
In c:
     int main(){         void main(){
         .....            .......
         .....       OR   ......
         return 0;         }
    }
 
Is This Answer Correct ?    2 Yes 1 No
Ppp
 
  Re: What is the difference b/w main() in C language and main() in C++.
Answer
# 4
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 ?    2 Yes 1 No
Ayush Jindal
 
  Re: What is the difference b/w main() in C language and main() in C++.
Answer
# 5
there is no difference b/w in c & c++ in main() function.
 
Is This Answer Correct ?    0 Yes 0 No
Ayush
 
  Re: What is the difference b/w main() in C language and main() in C++.
Answer
# 6
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 ?    0 Yes 0 No
Sagarika
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;  7
Why preprocessor should come before source code?  2
What is Heap?  3
what are brk, sbrk? Oracle1
Write code for initializing one dimentional and two dimentional array in a C Program? Deshaw5
what is the difference between const char *p, char const *p, const char* const p Accenture4
parkside's triangle.. create a program like this.. enter the size: 6 enter the seed: 1 output: 1 23 456 7891 23456 789123 sample2: enter the size: 5 enter the seed: 3 output: 3 45 678 9123 45678 parkside should not exceed 10 while its seed should only be not more than 9..  4
Determine if a number is a power of 2 at O(1).  1
N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3 Honeywell2
different between overloading and overriding  3
How can I convert integers to binary or hexadecimal?  2
main() { printf(5+"Vidyarthi Computers"); }  6
Difference Between embedded software and soft ware? Bosch1
what is volatile in c language? TCS1
which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..} TCS2
write a program for even numbers?  8
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); } TCS6
how many header file is in C language ?  14
i want to job in your company, so how it will be possible. TCS2
What are Storage Classes in C ? HP15
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com