Turbo C++ – Simplest Program
December 6, 2012 Leave a comment
Open turbo C++ and type following lines of code.
#include <iostream.h>
int main()
{
cout<<”happy programing ! “;
cout<<”Are you enjoying”<<endl;
return 0;
}
Compile and Run the code. The code will run but before you monitor any output it will exit. In order to see output add a call to function getch(), it is a built in function which gets a character from console but does not output it to the screen, so in order to use it you need to include this “conio,h” header file. Your code should now look like this:
#include <iostream.h>
#include<conio.h>
int main()
{
cout<<”happy programing ! “;
cout<<”Are you enjoying?”<<endl;
getch();
return 0;
}
The above code should work fine now.
If you use Visual Studio, you will find source code for the same program here.
If you use Dev C++, you will find source code for the same program here