how to print the hello

S

sudhir

The c++ program is:

#include<iostream.h>
void main(void ) {;}

Now without affecting the above two lines if I want to print the
"hello", how to do that..Please provide me the solution

sudhir
 
R

Rolf Magnus

sudhir said:
The c++ program is:

#include<iostream.h>
void main(void ) {;}

That's not a C++ program.
Now without affecting the above two lines if I want to print the
"hello", how to do that..Please provide me the solution

Maybe you should do your homework yourself?
 
B

Ben Pope

sudhir said:
The c++ program is:

#include<iostream.h>

// this header is not standards compliant, so it cannot be done in C++
void main(void ) {;}

// main returns an int, always, so this is not standard C++
Now without affecting the above two lines if I want to print the
"hello", how to do that..Please provide me the solution

I guess that's pretty implementation defined. Neither of the above two
lines are actually C++, so it is not topical here.

It's also been asked more than once in the last month, so search the
archives with groups.google.com

Ben Pope
 
T

Tomás

sudhir posted:
The c++ program is:

#include<iostream.h>
void main(void ) {;}

Now without affecting the above two lines if I want to print the
"hello", how to do that..Please provide me the solution

sudhir

If a C++ teacher or lecturer gave you that code, tell them I said he or
she is incompetent.

Here's how to print "Hello":

#include <iostream>
using std::cout;

int main()
{
cout << "Hello";
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top