Verify the following statements by observing in detail the CPP program codes tha
ID: 3856640 • Letter: V
Question
Verify the following statements by observing in detail the CPP program codes that you have written in previous exercises. The following statements can be true or false. #include must be written at the beginning of the program code so that the compiler will understand you are writing a program in cpp. using namespace std: is not important and can be ignored in the program codes. int main() represent the entry point (start point) of the program execution. system ("PAUSE"): is compulsory in every CPP program. return 0: is not important and can be ignored in the program codes. return 0: can be placed at the beginning of the program. {} the curly braces in the program codes can be replaced with round bracket ()Explanation / Answer
I dont have the actual code snippet of the CPP programme Hence, I am answering this in generic .
(a)iostram is basically the library file where all the attributes for standared input and output is stored .
In order to perform all the read or write operations to the standard input/output streams it is needed.
Without including io stream the programme will not compile .
So the answer would be TRUE
(b) Using namespace std : means , like
using : You are using it
namespace : The thing you are going to use is a namespace
std : The name of the namespace is std (where features of the C++ Standard Library, such as string or vector, are declared).
Now , it tells complier that symbols that are declared in the std namespace need to be bring in the programme .
So , it is not a mandatory option
So the answer would be TRUE
(c)int main() means that function returns int value
and main function starts a programme
So the answer would be TRUE
(d)system("pause") helps the cpp console to pause the operation and wait for a keyboard input to continue.
Moreover this command only work for Windows not for the LINUX systems
So, This command is not mandatory
Hence the answer would be False
(e)Return 0 is not a mandatory option there are other ways by which the main function will return values without declaring the return 0 function
But as per the coding standard using of this is recomended .
Hence the answer would be TRUE
(f) By giving Return 0 at the begining of the programme , It will return from the main function So you will exit from the programme But , you have to use this atleast after main function .
Hence the answer would be TRUE
(g) Curly braces and Round brackets have two different meanings
Hence , We can not replace that in the programme
So , the answer would be False
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.