UrbanPro
true

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

My first C++ program

Juhi G.
09/07/2021 0 0

# include

using namespace std;

int main()

{

cout<<"Welcome to C++";

return 0;

}

  1. Use IDE such as CodeBlocks to run this program. To do this, open CodeBlocks, Goto File->New->Empty File.
  2. Copy the above code and go to File->Save the file. Give a name and extension .cpp.
  3. About the program: Program execution ALWAYS starts from the main; this is a function. We will discuss more functions in later discussions; for now, consider it as a machine. You give some input; you get some output. Cout << is used to print any output messages or display any information. Remember to enclose messages in double-quotes.
  4. Dont forget to end lines with semicolons.
  5. Return 0 returns an integer value 0 for function main.In easy terms, it tells that everything worked fine.
  6. Functions always have opening and closing brackets.
  7. # include is a preprocessor directive telling the compiler to add header file iostream before including the rest of the program.IOSTREAM is an Input-Output stream. It allows you to use various objects related to I/O.
  8. Using name std. C++ has a standard library that contains common functionality you use in building your applications. The using namespace means that in the scope it is present, make all the things under the std namespace available without having to prefix std:: before each of them.
0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Importance Of Function Prototype In C
Function prototype tells compiler about number of parameters function takes, data-types of parameters and return type of function. By using this information, compiler cross checks function parameters and...

Tress And Its Traversal
Depth First Traversals:(a) Inorder (Left, Root, Right) : 4 2 5 1 3(b) Preorder (Root, Left, Right) : 1 2 4 5 3(c) Postorder (Left, Right, Root) : 4 5 2 3 1 Trees are one of the data structures like...

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

Creating a class in c++
Introduction Before we proceed with understanding as to how to create a class in c++, we need to first understand the what is a class. Definition : A class is a container of related data and methods...
M

Mahesh C

0 0
0

Do You Know Size Of Empty Class and Reason?
Size of empty class is always 1 byte. Reason is, in order to differentiate one object to another object, the size of empty class is always 1 byte. See the below c++ code snippet. Here there are three...
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more