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

Why is the C language important?
C language is a high-level, general-purpose programming language. It provides a straightforward, consistent, powerful interface for programming systems. That's why the C language is widely used for developing...
Ganesh
0 0
5
What is the program for print calendar?
int fm(int date, int month,year) { int fmonth, leap; //leap function 1 for leap & 0 for non-leap if ((year % 100 == 0) && (year % 400 != 0)) leap = 0; else if (year % 4 == 0) ...
Yatindra
Which is the best C language IDE/compiler for Windows?
Let us now check out some of the famous and best-working IDEs available. Visual Studio Code. Visual Studio Code is one of the most popular IDEs and is open-source software developed by Microsoft....
Deepashri
0 0
5
How do I learn C++ from the basics?
First you learn C LANGUAGE
Priyanka
0 0
6

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

Ask a Question

Related Lessons

Why C is a Language and not a database?
When I interviewed a candidate, I raised this question many times, but I have not got the answer correctly. To under why C is a language and not a database, it is good to understand why our communication...

Everything about printf in C language
What is printf and from where it comes from in C code.? You must have used printf so many times in your Car programs but do you really know everything about printf? Let's see. What is the full form...

Efficient Learning Strategies
Type your notes after class Write your notes onto flashcards - Scrabble -Make posters Review flashcards while walking, at gym, etc. Dog-ear pages in the reading where you can find...

Why do pointers have a datatype?
Before we start with pointers you must know what is a variable and a datatype. int a; This is the basic line in every program in 'C' . It means that we are asking the compiler to give us 2 bytes of space...

Can we store different data types in a stack?
Yesterday, one of my Facebook friend asked me this question. My answer is "yes", and in this post I will discuss how could we do this.I am a great supporter of working with unions and I will be using union...

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