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

What are the Advantages of using macro

0 Answers  


What does the function toupper() do?

0 Answers  


At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with these names could be kept in that shelf as in this example: bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf. All these packets are to be loaded on cars. The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,………….]. Each Car will load the packet with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. Each particular car will come at the loading point only once. The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come. No matter how deep in the shelf any packet ‘B’ is, all of the ‘B’ packets will be displaced before the ‘C’ car arrives. For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX]. If any shelf is used once, then it could be used again only if it is vacant. Packets from the initial shelf could be unloaded from top only. Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

0 Answers   Infosys,


write a program to find the largest and second largest integer from an array

2 Answers   Value Labs,


What is modifier & how many types of modifiers available in c?

0 Answers  






What is the value of uninitialized variable in c?

0 Answers  


Can you pass an entire structure to functions?

0 Answers  


Input any no. and print all the the numbers that comes before it like this for e.g input = 4 0 01 012 0123 01234 plz answer it 2day

3 Answers  


Can you write the function prototype, definition and mention the other requirements.

0 Answers   Adobe,


What are the standard predefined macros?

0 Answers  


why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?

2 Answers  


what information does the header files contain?

6 Answers   BSNL, Cisco, GDA Technologies,


Categories