Before start learning C++ programming, you need to know how to write first program in C++.
But Wait !!
It is not just a hello world program, there is something more. So, Let’s see.
#include<iostream>
using namespace std;
int main()
{
cout<<”Hello World !”;
return 0;
}
#include<iostream> - Header File contains all the functions including cout, cin
using namespace std – Namespace Library for std features. We will discuss is later in a separate topic
int main() – Main function execution begins
cout<< - used to print something
return 0 – used to end program
Wait !
If you are using any of the compiler the above code will work, but for turbo C++ rule is little bit different. Let’s see that also to avoid any further confusion.
Come on ! Just going to finish ! Few Lines More !
So, What’s New in Turbo C++
#include<iostream.h> - Why extra h? because no namespace
#include<conio.h> because getch(); to terminate the program, return 0 is not supported in turbo c++
void main() – Why ?
Meanwhile Turbo C++ - It’s my choice. Only supports void main()
Anything Left ??
Nah !!!
Move to Next Page
---------------------------------------------------------------------------------------------------------------------
Previous Page Next Page
Any Doubt ? Feel free to write a comment
Join us on LinkedIn – Great Place of Networking
Follow us on More Together – Facebook for regular updates
Mandatory to join Telegram group for regular job updates
Mandatory to join whatsapp group for regular job updates
Other C++ Topics
For Other Tutorials – Click Here