Showing posts with label structure in c programming. Show all posts
Showing posts with label structure in c programming. Show all posts

Saturday 17 March 2018

Structure in c programming


Structure in c programming:-

C supports following program structure

  1. Preprocessor Commands
  2. Functions
  3. Variables
  4. Statements & Expressions
  5. Comments

Lets start with simple code :-


        #include<stdio.h>

int main()
{
    printf("Hello, Devesh\n");
    return 0;
}

Note:-

#include<stdio.h> :-It is  a standard for input / output, which allows us to use some commands which includes a file called stdio.h


int/void main():-It is the main function where program execution begins.Each C program must contain only one main function.

Curly braces:-Two curly brackets "{.......}" are used to group all statements in the program.

printf():- It is a function in C, which displays text on the screen.


return 0:- It terminates the main() function and returns the value 0.

For more info click here