Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ episode 3(A program).
#1
In this tutorial we will make a program using,things which we explained in the first and second episode.

I hope that you like it.

(input)
Code:
#include<iostream>

using namespace std;

main()
{

cout<<"My program"<<" is created by me.\n"<<endl;
cout<<"Now i will leave\tSPACE"<<endl<<"Nice?"<<endl;
cout<<"Now is the funny\nWe will"<<"\n"<<"hear two sounds.\a\a\nhehehe.\n";
}

(output)
Code:
My program is created by me.

Now i will leave       SPACE
Nice?
Now is the funny
We will
hear two sounds.
hehehe.

(explanation)
Code:
#include<iostream>

using namespace std;

main()
{

cout<<"My program"<<" is created by me.\n"<<endl;//leave 2 lines using \n and endl.
cout<<"Now i will leave\tSPACE"<<endl<<"Nice?<<endl";//I left space using /t and two lines using 2 times the endl.
cout<<"Now is the funny\nWe will"<<"\n"<<"hear two sounds.\a\a\nhehehe.\n";//leave 3 lines using three times the /n and hear two sounds using 2 time the /a.

}

It was a program to understand better these things.

next tut will come soon.

Bye.
Reply
#2
Again HQ ! Smile Keep it up and you may receive a suprise PM
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)