How do I write a c++ program?



How do I write a c++ program?..

Answer / Shio Narayan

A C++ program consists of several parts: (1) include directives, (2) namespaces, (3) preprocessor commands, (4) function declarations, and (5) the main() function. Here is a simple example:nn```cppn#include <iostream>nnint main() {n std::cout << "Hello, World!";n return 0;n}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Explain one method to process an entire string as one unit?

1 Answers  


What is searching? Explain linear and binary search.

1 Answers  


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

1 Answers  


What are the 3 levels of programming languages?

1 Answers  


Is recursion allowed in inline functions?

1 Answers  


Describe private, protected and public – the differences and give examples.

1 Answers  


what do you mean by volatile variable?

1 Answers  


Can we define function inside main in c++?

1 Answers  


What is the difference between reference type and pointers.

4 Answers   HCL,


Differentiate between C and C++.

1 Answers   Wipro,


Should you pass exceptions by value or by reference?

1 Answers  


How do you remove an element from a set in c++?

1 Answers  


Categories