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

How do I check my C programming skills?
You should try to solve your daily life problems with c , i.e - build your own budget calculator or chess game and many more. Moreover make a habbit of solving 10 questions daily.
Ramnarayanan
0 0
5
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
Do every operator has an Associativity?
Yes, every operator will have an associativity.
Basundhara
0 0
5
How do I program a game using C program?
Programming a game in C involves several steps. Here's a simplified guide to get you started: Define Your Game Concept: Clearly outline the game's concept, rules, and objectives. Setup Your Development...
Sumitha
0 0
6
What exactly is \r in the C language?
In the C language, "\r" represents the carriage return character. When encountered in a string, it instructs the output device to return the cursor to the beginning of the current line. This character...
Sajini
0 0
5

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

Ask a Question

Related Lessons

Variables
Variables in C Language:A variable is a name that may be used to store a data value. Unlike constant, variables are changeable, we can change value of a variable during execution of a program. A programmer...

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

Swapping variable contents using C
/* WAP to swap the content of variables using C*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ //Variable declaration of type integer int a,b,c; //function...

Pro learners tip for C language
First get the concept of algorithm before heading to write your first program.

C Program to print Block Letter and Small Case Alphabets using C
/* WAP to print Block Letter and Small Case Alpahbets using C*/ //Hint:use ascii code(value) to print #include#include void main(){ int i; clrscr(); //Block Letters Alphabets printf("Block Letters Alphabets\n");...

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