How to Run a C++ Program Without Namespace? Last Updated : 02 Nov, 2022 Comments Improve Suggest changes Like Article Like Report Prerequisite: Namespace in C++ If we want to run a program without using a namespace, we have to the std keyword along with the space resolution operator (::) in every printing line and variable declaration, For example, std::cout<<"geeksforgeeks"; Example: C++ // C++ Program without the use of using namespace std; #include <iostream> #include <string> int main() { std::cout << "geeksforgeeks"; return 0; } Outputgeeksforgeeks Example: C++ // C++ Program without the use of using namespace std #include <bits/stdc++.h> int main() { int a = 5; int b = 10; int c = a + b; std::cout << c << std::endl; return 0; } Output15 Comment More infoAdvertise with us Next Article How to Run a C++ Program Without Namespace? R raj2002 Follow Improve Article Tags : Technical Scripter C++ Programs C++ Technical Scripter 2022 Practice Tags : CPP Similar Reads How to Pause a Program in C++? Pausing programs in C ++ is an important common task with many possible causes like debugging, waiting for user input, and providing short delays between multiple operations. In this article, we will learn how to pause a program in C++. Pause Console in a C++ ProgramWe can use the std::cin::get() me 2 min read How to Use stringstream for Input With Spaces in C++? In C++, the std::stringstream class is a stream class to operate on strings and is very useful when we want to operate on a string as if it were a stream (like cin or cout). In this article, we will learn how to use string streams for input with spaces in C++.Example:Input: string = âHello, World!âO 2 min read C++ Program to Create an Interface Interfaces are a feature of Java that allows us to define an abstract type that defines the behaviour of a class. In C++, there is no concept of interfaces, but we can create an interface-like structure using pure abstract classes. In this article, we will learn how to create interface-like structur 2 min read C++ Program to Show Runtime Exceptions A runtime error occurs while the program is running. Because this is not a compilation error, the compilation will be completed successfully. Here, we will learn how to handle runtime exceptions in C++. There are 5 types of runtime exceptions discussed here: Division by zero. Segmentation faults. La 3 min read Why it is important to write "using namespace std" in C++ program? In this article, we will discuss the use of "using namespace std" in the C++ program.Need of Namespace in C++As the same name can't be given to multiple variables, functions, classes, etc. in the same scope. So, to overcome this situation, namespace is introduced.ExampleBelow is the C++ program illu 4 min read C/C++ program to print Hello World without using main() and semicolon The task is to write a program to print Hello World without using main() and semicolon. As we already know, how to print Hello World without the use of a semicolon. Now, for writing without main() method, we will need a Macro. C // C program to print Hello World // without using main() and semicolon 1 min read How to Read a Paragraph of Text with Spaces in C++? In C++, we may need to read the input that includes the paragraph of text with spaces. In this article, we will learn how to read a paragraph of text with spaces in C++. Reading a Paragraph in C++To read a paragraph of text that includes spaces, we can use the std::getline() function that can read t 2 min read How to Take std::cin Input with Spaces? In C++, std::cin is used to accept the input from the standard input device. By default, the delimiter used by std::cin to separate input is a whitespace. In this article, we will learn how to take std::cin input with spaces in C++. Example: Input: Hey! Geek Welcome to GfG //input with spacesOutput: 2 min read How to Take Long String Input With Spaces in C++? In C++, we often take long strings with a lot of characters as inputs with spaces but if we use cin then our input gets terminated as soon as whitespace is encountered. In this article, we will discuss how to take long strings with spaces as input in C++. Take Long String Input With Spaces in C++To 2 min read How to Compile a C++ Program Using GCC In C++, the GNU Compiler Collection (GCC) is one of the most popular C/C++ compiler that is used to compile and execute the C and C++ program. In this article, we will learn how to compile a C++ program using GCC. Compiling a C++ Program Using GCC The GNU Compiler Collection (GCC) is a versatile too 2 min read Like