Void is a return type which is used before a function for defining that the function is returning no value.
The function main() is the main/head function of the program and used for the execution of our program. So it is no needed that we put a return type before main().. (an int return type is considered, when no return type is written).
So we do put a void return type before main() in our program.
The function main() is the main/head function of the program and used for the execution of our program. So it is no needed that we put a return type before main().. (an int return type is considered, when no return type is written).
So we do put a void return type before main() in our program.
You must have read about Functions in C.
Every Function in C returns a value to the Calling Function. You must have already seen this. Whenever you called a function by passing its arguments, it tells the calling function a value in return.
'main()' is also a function, that can be CALLED if you are using multiple files.
For example, if you are programming a game suppose hangman, you may wish to make a separate C file that stores the number of wrong alphabets entered, suppose 'Misses'. If so, later you'll need to call the 'main()' of 'Misses' in your final file.
Since you need an integer value, you'll have declared 'main()' of Misses as 'int main()'. Also, there will be some variable declarations in the brackets.
But if you're simply using only one file, then there's no value to be returned. So 'void main()' is written.
Every Function in C returns a value to the Calling Function. You must have already seen this. Whenever you called a function by passing its arguments, it tells the calling function a value in return.
'main()' is also a function, that can be CALLED if you are using multiple files.
For example, if you are programming a game suppose hangman, you may wish to make a separate C file that stores the number of wrong alphabets entered, suppose 'Misses'. If so, later you'll need to call the 'main()' of 'Misses' in your final file.
Since you need an integer value, you'll have declared 'main()' of Misses as 'int main()'. Also, there will be some variable declarations in the brackets.
But if you're simply using only one file, then there's no value to be returned. So 'void main()' is written.
Hai..actually the program execution starts with main() function.by default it returns a return type of int() type..if we want a specified return type we use int,char,float.....when we use void means if we don't want any return type..on that purpose only we use void return type
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.
The program execution starts from the function main this means main is a starting point of your program.
We use void main to restrict computer to input any value in the program.It is also a keyword.
Void main() is a predefined function in "c" from where we start a c program...the compiler begins its execution from main().
void means returing any value either(int,char ,float)when using with function like void main()
Static variables are the variables which retain their values between the function calls. They are initialized only once their scope is within the function in which they are defined.
Because of identification of starting of our our program for compiler
It is a function