it is always not necessary to write "void main " in C Programming.it depends on the source code we use if we have to return a value then void is not necessary because void returns the null.While coding in borland C++ we need to write void main but we dont need it in dav c++.
In C (and C++) the standard allows int main (void) and int main (int argc, char **argv)
void main() { printf("followiing"); }
This is really unclear. If you're asking why you should write void main() then the answer is that you shouldn't. main can return an int as an error code, so it's better to do int main() instead.
One.int main (void) { return 0; }
int main (void) { puts ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); return 0; }
int main (void) { puts ("Your name and address"); return 0; }
#include <stdio.h> int main (void) { puts ("Yes, I can"); return 0; }
int main (void) { if ('C' == 'C') puts ("Okay"); else puts ('Oh, gosh"); return 0; }
include <stdio.h> int main (void) { puts ("print"); return 0; }
#include <stdio.h> int main (void) { puts ("demonistrate"); return 0; }
#include <stdio.h> int main (void) { puts ("abcdefedcba"); return 0; }
int main (void) {puts ("day is holyday");return 0;}
Every C# application is started on the startup class' static Main method. Yes, it must be static, but void is not the only returned type. The 4 signatures:static void Main();static void Main(string[] arguments);static int Main();static int Main(string[] arguments);Ideally, there should be one and only one Main method in your application.