answersLogoWhite

0

Can you use two main in C programme?

Updated: 8/18/2019
User Avatar

Wiki User

13y ago

Best Answer

No. You can only have one main() function in a C or C++ program.

Note:

If this question means "Will the OS start two threads/processes if I have two public scope 'main' functions in my program?"

then the answer is "No, even if you could link such program, which you cannot."

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you use two main in C programme?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you use this function in c programme?

I don't use that function in C programme.


One line programme in c language?

int main (void) { printf ("One line programme\n"); return 0; }


Write a programme for substraction of two numbers in c language?

substracion of any two number program in c


Write a c programme to print all the even numbers in descending order?

#include(stdio.h) int main ()


How do you write c programme to find proper subset of a given string?

you can use strstr()


Write a programme in c to print abcdefedcba?

#include <stdio.h> int main (void) { puts ("abcdefedcba"); return 0; }


Programme for sum of two integers using C?

int a = 1; int b = 2; int c = a + b; // Sum


Write a programme to find greater among two numbers in c plus plus?

You could use an if, but the ternary operator is especially compact for this purpose: result = a > b ? a : b;


Why you use main function in c?

Because if you donot use main function in c program, the compiler willnot execute the program.C compiler starts execution from main function itself.


Make programme for multification of three no in c plus plus?

result = a * b * c;


How do you write a programme in c language using arrays to copy diagonal elements of a 2-d array into a 1-d array?

TO use a c language first step is to know about the c language and the steps to use the c progrmming language with the help of any elders or with the teachers. TO use the arrays you have to get th eknowledge of "c" language


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.