wap to print "hello world" without using the main function.
Answers were Sorted based on User's Feedback
Answer / sivasankar
#include<stdio.h>
#include<conio.h>
#define ksrct main()
ksrct
{
clrscr();
printf("hello world");
getch();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / vaibhav
@Deepika some correction:
#include<stdio.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 World");
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / ranjan
#include<stdio.h>
#include<iostream.h>
class World
{
public:
World()
{
printf("Hello world");
}
}
world w1;
Here the object is declared globaly.so when the object is
defined it will call the constructor of that & that will
display the "hello world". no need to write main. as it is
global.
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / siva
#include<stdio.h>
#include<conio.h>
#define siva main
siva()
{
clrscr();
printf("hello world");
getch();
return 0;
}
| Is This Answer Correct ? | 3 Yes | 5 No |
Answer / vignesh1988i
the basic format or the first executable code line is the
main function in C.... so if we try to print the anything
without main we are trying to modify the basic concepts of C
and this will not look nice....
thank u
| Is This Answer Correct ? | 20 Yes | 24 No |
Answer / kk
And some deserts for Mr. Vignesh1988i ..
For your kind attention sir.. Method main() is not the first
line in any executable... Have you ever heard of
initialization??
Yes you can say what ever the developer writes in any
program starts in main()..
| Is This Answer Correct ? | 3 Yes | 11 No |
Answer / kk
main() method is the entry point for any c/c++ program which
is compiled/linked as executable. C/C++ does not force
anyone to use only main() method as the entry point. This is
only the default behavior and can be changed. This is
generally slightly different for different compiler. But you
can do this.. Simply define any other method say noMe() to
be the entry point for the executable.
Who the hell uses main()to do main stuffs in any
executable.. It should have been called something like
start() ot begin().. :)
Well this is not the answer.. Just little guidance..
| Is This Answer Correct ? | 3 Yes | 16 No |
Answer / thirupathi reddy
by using the comment lines we can get the output
| Is This Answer Correct ? | 7 Yes | 35 No |
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student"
What are the different file extensions involved when programming in C?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Are the outer parentheses in return statements really optional?
What is the most efficient way to store flag values?
read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX) x=1; else if(x<MIN) x=-1; x=50; if the initial value of x=200,what is the vlaue after executing this code? a.200 b.1 c.-1 d.50
How do I convert a string to all upper or lower case?
How can I manipulate individual bits?
Why is the code below functioning. According to me it MUST NOT.
what is structuer?
What is function in c with example?
Hai friends im a i year student. i want to develop my knowledge in the field of TSR in c. How I'm Improve ?