answersLogoWhite

0


Best Answer

No you can't. main() is the entry point of a C program where execution starts. Only a single main() can exist in a C program. A program with 2 mains wil not even compile successfully.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you have two mains in a c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the two mains types of computer program?

Operating systems and application software.


Program to display multiplication of two matrix?

The matrix multiplication in c language : c program is used to multiply matrices with two dimensional array. This program multiplies two matrices which will be entered by the user.


C program for comparison of two words?

strcmp


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

substracion of any two number program in c


Can you use two main in C programme?

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


How to write aC program to merge two singly linked list?

write a c program to circular queue


Can you have multiple main method in the same class?

according to my knowledge it is no a main can have multiple classes but a class cannot have multiple mains...main indicates the beginning of a program and if we have n number of mains then the compiler will show an error in all the main program that we write


What M L C V indicates in wattmeter?

mains common load voltage (M C L V)


Is there a c program to multiply two polynomials using linked lists?

yes


Is there any benefit in a C plus plus program to add two matrices?

No.


C program was introduced in the year?

c program was introduced in the year 1972 by Dennis RitchieNo, it was the C language, not the C program.


Features of c program?

the features of a C program