Getting Started

 

 The main( ) function

 

type of returned value

function name

argument list

function body

int

main

(  )

{  }

 

The braces { and } determine the beginning and end of the function .

 Small C program

 Small C++ program

#include<stdio.h>

int main ( )

{

  printf ("Hello World ");

  return 0;

}

#include<iostream.h>
int main ( )
{
cout<<"Hello World ";
return 0;
}

Examples

(1) Return 6;

      No errors

 

(2) Return 0;

      printf(“hello”);

      No print is there

 Programming style