answersLogoWhite

0

How do you call main method in C?

User Avatar

Anonymous

13y ago
Updated: 8/16/2019

#include <stdio.h>

int n=3;

void main(int m)

{ m=n;

while(m>=1)

{

printf("OUG Tree\n");

return main(n--);

}

getch();

}

well this program calls main three times within itself prints OUG Tree 3 times

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Can you write multiple Mains in C-Sharp programming?

No. There can only be one main method, however you can declare new methods, and call them from the main method. Or you can use multi-threading, to simulate having multiple main methods.


How do you call a method from inside the main method?

I assume the question is about Java. How you call a method from inside the main method depends on whether this is an instance method or a static method. To call an instance method, you need to have a valid instance. Say foo is an instance of class Foo, which was created inside the main method. Then to call the instance method implode() use foo.implode() To call the static method bar() of class Foo, use Foo.bar().


Why main method only called by jvm why not any other our own static method?

At the time of developing jvm the development team by default make a only one method call i.e; 'main' method call in the jvm that's why when the call is loading into the jvm the jvm call the main method...and execution was starts..


Can the main method call the other method if it is not defined as static?

No


How do you call main class with in main class in java?

We can't call a class. We always call a method in java.


What do you call an object function in c plus plus?

method


Use the Multiple Main method C?

There are no methods in C, and you should have only one main function.Methods are associated with a specific class, and there are no classes in c.


Can a C program be written without main METHOD?

Every program requires an entry point. Main() provides the entry point in C.


Can you call main in c plus plus?

Of course.


Can main method be non-static?

No, the reason is simple: A method marked as a static means, that you don't need create an instance (create an object with the 'new' operator) in order to use it. The main method is the entry point for a java application, therefor there is nothing after you call it. no one who can create an object of the type of your class and call the main method. So the jvm must call the main method with no object reference.


Why main is static?

The main method is static because the JVM would be invoking this method as the starting point of execution. If this is like other normal methods, the JVM would have to instantiate an object of the class before it can call it. This is not possible because this is the starting point. If the main method is static the JVM can directly call this by specifying the class name.


How do you call global variable value in main method if main method contains same variable holds another value?

we can call global variables in main method by using scope resolution operator(::) if local and global have same name for example int x=10; main() { int x=20; cout&lt;&lt;x; //x=20 cout&lt;&lt;::x; //x=10 }