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 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 Like