wap to print "hello world" without using the main function.
Answer Posted / 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 |
Post New Answer View All Answers
What is the difference between array and structure in c?
What is a newline escape sequence?
Explain the difference between #include "..." And #include <...> In c?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Write programs for String Reversal & Palindrome check
Differentiate between static and dynamic modeling.
What is double pointer?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
Why enum is used in c?
What is the difference between exit() and _exit() function in c?
What are reserved words with a programming language?
What is the difference between array and pointer in c?
Explain how can I remove the trailing spaces from a string?
What is the meaning of && in c?