UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is void main () into main and what it does?

Asked by Last Modified  

Follow 12
Answer

Please enter your answer

Have 10+ years experience in IT Education and Projects

Void main () is the entry point for execution in C program. The void is a keyword that represents function will not return anything but a void value. Main is the name of the function and () represents parameter list that can be passed to function in this case nothing is passed. Syntax of main function...
read more

Void main () is the entry point for execution in C program. The void is a keyword that represents function will not return anything but a void value.

Main is the name of the function and () represents parameter list that can be passed to function in this case nothing is passed.

Syntax of main function is :
dataType main()
{
// your code here

}

in the above function, dataType is the type of data (int, float or string) return by the main function.

read less
1 Comments

.NET Professional Trainer with 12 years of experience

Void means nothing or empty. void main() - means here main() return nothing.int main() - means here main() returns an integer value.
1 Comments

Void is return type of function.
Comments

I am senior Full Stack developer and corporate trainer with 10 + years of experience in IT Industry.

The void is a data type which tells to compile; it is a return type of the main function. The main is a predefined function which is the entry point of every program.
Comments

Void main is the entry gate of the program when you run the program then this is called first by the compiler.
Comments

Learn only to Achieve Success

Void main is a function which does not return any value. Or in the simple form, it is null so we can return anything. If used int main will requires returns 0 or any value as maths rule LHS=RHS.
Comments

Computer Science Engineering - Assistant professor

When nothing is to be returned from the main function, we write void main() because void is taken as NULL. When the value to be returned is in integer format, we write int main().
Comments

Trainer

As we know, C Language is a Procedural language, where the emphasis is on functions or procedures. The main() is a function from where any C Program starts execution and void is a keyword which is used in the place of function's return type which means the function will not return any value at the point...
read more

As we know, C Language is a Procedural language, where the emphasis is on functions or procedures. The main() is a function from where any C Program starts execution and void is a keyword which is used in the place of function's return type which means the function will not return any value at the point of call.

read less
Comments

Main () is the function from where program execution starts. And the void is the empty return type.
Comments

IT Professional and Trainer with 14 years of Teaching Experience

Hello Noreen, In simple terms, the void main() is an entry point of c, c++ or Java program. In C, C++ or Java, the program starts execution from the main function. Now let's talk about the main part of your questions what is void in void main(). C has statically typed programming language before sending...
read more

Hello Noreen,

In simple terms, the void main() is an entry point of c, c++ or Java program.

In C, C++ or Java, the program starts execution from the main function.

Now let's talk about the main part of your questions what is void in void main(). C has statically typed programming language before sending it to the compiler we always need to specify the return type of function. If the function is returning any value which is going to be used in an expression, then you should specify a return type, e.g. int, float, char.

If the function is not returning any value at that time, you must specify void so that compiler won't look for the return value in the function.

If you're using modern compiler like GCC, you need to specify int main so that where you can return 1 or 0 or -1 to the loader.

Also, don't get confused between Null and void. There is a different meaning of null in programming. Null is considered as a value or constant when you want to create a variable you can assign null value, but you can't assign void to any variable. 

I hope this will clear your doubt. If not, try to practice on the same and learn from errors.

Happy Coding :)

read less
1 Comments

View 48 more Answers

Related Questions

Can an array be an lvalue?
The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal:...
Vinodha
What is the use of semicolon at the end of every statement?
Computer languages are just like our normal communication languages. Hindi, eng etc. Enable to communicate us with each other. Similarly computer language helps us to communicate with computer. As a full...
Krishna
In which program we use character constants?
For the name of months, animal, colors we do use it.
Mona
How do I learn C programming by videos or books?
BOOKS AND PRACTICE by far remain the best way for learning any language ....
Fgrefg
0 0
7
How to enroll for the course?
register here then post your requirements,do provide your ph no by which trainers can contact you or you can individually search for trainers nearest to your location and contact them.
Alpana

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Array vs Linked List
Array Linked List Accessing element is easy. Accessing element is difficult compare to Array. Easy to use. Difficult to use. Memory is Fixed size. Memory is variable size. If...

Pointers and References
Are reference and pointers same? No. I have seen this confusion crumbling up among the student from the first day. So better clear out this confusion at thevery beginning. Pointers and reference...

What is Safety-Critical Software?
A software whose failure may cause death or injuries to the users called Safety-Critical Software.The software present as part of Aeroplanes, or present in Rail as railway signalling software or Automotive...

Operators in C
Operators in C Operator: An operator is a symbol that tells the compiler to perform certain mathematical or logical calculations. Operators are used in programs to manipulate data and variables. The...

Some interview questions for freshers on C language
Q1. What are the two forms of #include? There are two variants of #include. The one is #include and the other one is #include”file”. In general the first form that is #include is used to...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more