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 9 + 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

What is the best IDE for C and C++ development?
If you're a student then Turbo C++ is best for C and C++ program + inbuilt C/C++ Graphics Function If you're a professional or working then Netbeans for C/C++ or Code:: Blocks is Best.
Balakrishnasingh
How do I write a C program to print the total number of a single-digit prime number using a loop?
total number of single digit prime number that means your prime number starts from 2 and less than 9 so you can take loop for this range
Momin
0 0
7
Is C programming the best for beginners?
Yes, it is good to start with C so that other programming would be easy to understand
Amit
0 0
7

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...

C++ Program-Working with constant using #define preprocessor
//Header Files #include#include // using #define preprocessor for defining a constant#define len 10#define br 5#define rad 3#define NEWLINE '\n' //Main function void main(){ int area_r; float area_c; //Function...

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

Do You Know How Is Size Of Structure Defined?
Size of the structure is defined based on multiplies of bigger data type member in the structure. Example: If a structure contains integer, char, short data type, then size of the Structure will be multiples...

C Program-Temperature [conversion from farenheit to degree celsius]
//WAP to convert temperture from farenheit into degree celsius //Header files#include<stdio.h>#include<conio.h> //Main functrion void main(){ //Variable declaration of type float float...

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