Presentation On Components of Programming-1
Presentation On Components of Programming-1
ICT(Information and
communication
technology)
C Program Structure:
cCopy code
#include <stdio.h> // Incl
// Coprintf
( "Hello, World!" ); // Print a message to the console return 0 ; // Indicate successful execution }
Breakdown:
{ ... }:
3. Curly braces define the scope of the main function. All the code inside the
curly braces belongs to the main function.
4. // ... or / ... /: These are comments in the code. Comments are ignored by the
compiler and are for human readers to understand the code better. // is used
for single-line comments, and /* */ is used for multi-line comments
.
5. printf("Hello, World!"); (in C) or std::cout << "Hello, World!" << std::endl;
(in C++): These are examples of output statements. They print "Hello, World!"
to the console.
6. return 0;: Indicates the end of the main function and typically signifies
successful execution. The value 0 is returned to the operating system.