Explain the structure of a code in c++.

Answer

#include<iostream>

int main()

{

std::cout<<"Hellon";

return 0;

}

 

An ideal structure of the code:

  1. #: Preprocessor directive (used to include files)
  2. <iostream>: Header file for taking input and printing output.
  3. main(): code execution begins from here
  4. std: standard (instead of writing std again and again we import namspace std before main function )
  5. cout: Used to display output in quotation
  6. n: add a line break
  7. ; : marks the end of the statement.
  8. return 0: exit status of a function
  9. {}: Curly braces indicate the start and end of the function

All c++ Questions

Ask your interview questions on c

Write Your comment or Questions if you want the answers on c from c Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---