Basic Doubt Regarding C++ Programming

Asked By 30 points N/A Posted on -
qa-featured

Hey People, 

I have Just learnt the Basics of C++.

I have recently written  my first program.

What is the difference between the two codes..

Code 1

cout<<"Hello" <<"t" <<"world";

Code 2

cout<<"Hello World";

Also How do I test the output of a C++ file?

Thank you for your Help.

Mikey

SHARE
Answered By 0 points N/A #109112

Basic Doubt Regarding C++ Programming

qa-featured

Nice to hear that you are learning some programming stuff.

The question post is very nice and my answer could be as follows

Code 1

cout<<"Hello" <<"t" <<"world";

Ans: Outputs with Tab space in between Hello and World where as in the Code 2  there will only one space as given in the code.

Code 2

cout<<"Hello World";

The code you have given is called as a statement in programming stuff, a statement is a simple or compound expression that can produce the some results accordingly. cout is the name of the standard output stream in c++ which inserts the sequence of characters into the standard output stream.

Press Ctrl+f7 to compile your code and press Ctrl f9 to execute your program . Or you can find the execute command in your editor.

Thanks

Eemmy

Related Questions