Flag Modern Physics> C++...
question mark

What is the significance of 'void' in --void main()-- ?Please explain me about this in detailI'll surely approve all correct answers.

Nitin Gupta , 14 Years ago
Grade 11
anser 2 Answers
suryakanth AskiitiansExpert-IITB

Last Activity: 14 Years ago

Dear Nitin,

Main is a driver function. Void is a return type of the main function void means not returning any thing.
The program execution starts from the function main this means main is a starting point of your program.

Please feel free to ask your queries here. We are all IITians and here to help you in your IIT JEE preparation.

All the best.

Win exciting gifts by answering the questions on Discussion Forum. So help discuss any query on askiitians forum and become an Elite Expert League askiitian.

Now you score 5+15 POINTS by uploading your Pic and Downloading the Askiitians Toolbar  respectively : Click here to download the toolbar..

 

Askiitians Expert

Suryakanth –IITB

Nitin Gupta

Last Activity: 14 Years ago

Not returning anything means not returning a value.But we do return a value in  programs.For ex:-

#include<iostream.h>

#include<conio.h>

void main()

{

int a,b;

cout<<"Enter two values : ";

cin>>a>>b;

cout<<"\n Sum is : "<<a+b;

getch();

}

In this example we do return a value of -- a+b;But the void function doesn't return a value.So where I got wrong?Please let me know

Provide a better Answer & Earn Cool Goodies

Enter text here...
star
LIVE ONLINE CLASSES

Prepraring for the competition made easy just by live online class.

tv

Full Live Access

material

Study Material

removal

Live Doubts Solving

assignment

Daily Class Assignments


Ask a Doubt

Get your questions answered by the expert for free

Enter text here...