I am a kid of 15 and just started learning cpp. I want to make a simple programme wherby if i say hi to the computer it must respond by saying hello to me. So please give the coding or programme for it.

Votes + Comments
This is a basic requirement / homework - we don't provide solutions for homeworks.
2 Years
Discussion Span
Last Post by David W

Do NOT use the above link ... because, the 'Hello World' example program there does NOT conform to standard C++ ... Standard C++ uses: "int main()"

#include <iostream>

//using namespace std;

int main()
    // your code goes here ... for example ...
    std::cout << "Hello World" << std::endl;

    // keep window open until 'Enter' key pressed ...

    // if next line left off, the standard C++ compiler will add code
    return 0;

Note: the C/C++ main() function returns an integer

You may like to see the (pre C++11) examples here:


If you want to start out with C++14 ... you might like to see this also:


by Ivor Horton

Edited by David W

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.