can we write a c program with out using main

Answers were Sorted based on User's Feedback



can we write a c program with out using main..

Answer / durga mahesh

Say Big Nooooooooooooooooo..........
Its never ever possible bcoz when a program is compiled the compiler always looks for the entry of the program initially(this is the first and foremost action performed by compier)
In c,main() is the entry section...exectuion begins only after main is checked....

Is This Answer Correct ?    20 Yes 12 No

can we write a c program with out using main..

Answer / arun kumar

#include<stdio.h>
#include<conio.h>
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)

int begin()
{
printf(" hello ARUN");
getch();
}

Is This Answer Correct ?    6 Yes 2 No

can we write a c program with out using main..

Answer / kamini

#include<stdio.h>
#include<conio.h>
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)

void begin()
{
printf(" hello ARUN");
getch();
}

Ans was correct but if the function is declare int dn it has to be return some value so it should be void.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Is c is a low level language?

0 Answers  


how to find your architecture is LittleEndian or BigEndian?

1 Answers  


How do you define CONSTANT in C?

0 Answers   ADP,


Can include files be nested? How many levels deep can include files be nested?

0 Answers   Aspire, Infogain,


What is c language and why we use it?

0 Answers  






What is the output of the following progarm? #include<stdio.h> main( ) { int x,y=10; x=4; y=fact(x); printf(ā€œ%d\nā€,y); } unsigned int fact(int x) { return(x*fact(x-1)); } A. 24 B. 10 C. 4 D. none

2 Answers  


There is a 100-story building and you are given two eggs. The eggs (and the building) have an interesting property that if you throw the egg from a floor number less than X, it will not break. And it will always brake if the floor number is equal or greater than X. Assuming that you can reuse the eggs which didn't broke; you got to find X in a minimal number of throws. Give an algorithm to find X in minimal number of throws.

5 Answers   Yahoo,


What's the best way to declare and define global variables?

7 Answers  


Write a program to check palindrome number in c programming?

0 Answers  


What is the difference between typedef struct and struct?

0 Answers  


how to make program without <> in libray.

0 Answers  


Is boolean a datatype in c?

0 Answers  


Categories