DEV Community

Atanu Pal
Atanu Pal

Posted on

Few Questions You Should Know Before Coding! In C++.

Q. What is the use of "using namespace std" in C++?
Ans:- Namespace in C++ is the declarative part where the scope of identifiers like functions, the name, the type, classes, variables, etc are declared. The code generally has multiple library and the namespace helps in avoiding the ambiguity that may occur when two identifiers have the same name.

Q. What is an identifiers?
Ans:- An identifiers is a sequence of characters used to donate one of the following object or variable name. Class, structure or union name.
Examples:x, y, sum, age, etc

Q. Why we use () first braces?
Ans:- We generally use() after inter main() because main is nothing but a function and every function has a brackets after the name of the function to pass the parameters.
Brackets indicates the use of keyword we have written is function.

Q. Why we use {} curly braces?
Ans:- Curly braces are used to define the scope of variables and to group statements together in a block. They are used to define the body of a function, a class, a loop or a conditional statement.

Q. Why we use [] square braces?
Ans:- Square braces are used to access elements of an array or a container.

Q. Why we use semicolon in our code?
Ans:- In programming semicolon are used to indicate the end of a statement which allows the computer to know when one statement ends and another begins.

Top comments (0)