Keywords in C

  • There are some rules in constructing C .
  • For that we need to know some key words . so that C can compile and execute the output.

Some of them are:

keywords

Before getting into this , we shall get know some basic rules:

  • We have to give each instruction as a separate statement. A complete C programe is bunch of some statements.
  • The order of statements can be given in the way which we want to execute.
  • B/w two variables , constants , keywords. However we can give infinite blank space b/n two words.
  • It Is necessary that All statements are entered in small case letters.
  • Every C statement must end with ; . thus, ; acts as a line terminator.
  • C is a free form language as there are no specific rule for where the statement write

Now we shall discuss about a simple example.

		
/* my first program in C */ #include <stdio.h> #include <conio.h> void main(){ clrscr(); printf("Hello ,we are geeklabs”); getch(); }

Explanation of above example:

  • /*(your comment )*/
    It helps you to comment about the program. Though comments are not necessary it good to practice as it indicates the purpose of program.
  • #include<stdio.h>
    Is a preprocessor command or headerfile which tells a C compiler to include stdio.h file before going to the actual compilation in the program and makes the operations like printf(), scanf() etc;
  • #include<conio.h>
    Is a headerfile or preprocessor command which makes.
  • void main()
    Main defines existing function and program exection starts with it. And void refers to no written value.
  • clrscr
    Its full form is clear screen. It operation is to clear the data of the before program we have done. If we don’t use it we get the before data along with running data in output.
  • printf(statement)
    whatever the statements or characters we give in this , it will be printed in the output .
  • getch()
    This function provides us to see the output for a long time . If we do not use it our output we be shown in fraction and we return to our input.
Meaning of:
  • Stdio.h: standard input output headerfile.
  • Conio.h: console input output headerfile.
HTML Comment Box is loading comments...