C Statement

What is a C statement

Each executable statement is terminated by ';'.

Example for a statement

The following code uses statement of printf("Hi \n"); to output a message to the console.


#include <stdio.h>
/*ww  w.  ja  va 2s . c  om*/
main(){
  printf("Hi \n");
}

The code above generates the following result.

What is C statement block

The statements are enclosed within a block marked by '{' and '}'.

Example of C statement block

The following code uses statement block to output two messages.


#include <stdio.h>
main(){/*from  w w w  .ja  v  a2  s . c  o m*/
  printf("Hi \n");
  printf("Hello \n");
}

The code above generates the following result.





















Home »
  C Language »
    Language Basics »




C Language Basics
Data Types
Operator
Statement
Array