Skip to main content

Keywords and Comments in C


KEYWORDS IN C

For better blogs do comment your opinion and share the blog


What are Keywords?

Keywords are the words that convey a special meaning to the compiler. This means the meaning of every particular keyword is already defined to the compiler of the Language.
There are total 32 Keywords in C Language and all have their meaning fixed to the compiler.
These are the keywords in C.

auto
double
int
struct
break
else
long
switch
case
enum
register
typedef
char
extern
return
union
const
float
short
unsigned
continue
for
signed
void
default
goto
sizeof
volatile
do
if
static
while

The Keywords in Red are the data types they are used to define the data type of a variable.
Example: int i; float f; char ch; long l;
The Usage of these keywords will be covered as they arrive in programming.



COMMENTS IN C

  • ·       Comments are used in programs to explain or justify meaning of a program or any statement or any set of code.
  • ·       Comments are also used for documentation of a program or project in which the name of program, aim of program, date of program development can be written.
  • ·       Comments make it easy for a person other than the developer to understand the set of code.



Types Of Comments

In C there are only Single Line Comments, which means the single comment can be of one line only.
The Single Line comments are written in two ways
1.    By Using /* to start a comment and */ to end a comment.
2.    By Using (double Slash) // followed by comment to be written.

Example:

#include<stdio.h>    /*including standard input-output method.
#include<conio.h>   //including console input-output method.
void main()              //the main function.
   {

}


Comments

  1. Very helpfull for begineers.....great work...keep going.Waiting for your Array content...plss do it fast.

    ReplyDelete
  2. Helpful..waiting 4 function part

    ReplyDelete

Post a Comment

Popular posts from this blog

Data Types In C: Size, Range and Usage.

DATA TYPES IN ‘c’ Data types are keywords which specify the type of data which is used in the programs of C language. Different data types have different storage capacities and different range of data. There are mainly two main categories of data types. PRE-DEFINED DATA TYPES/PRIMARY DATA TYPES INTEGER TYPE DATA TYPES Integer type data type is used to store a whole number or integer number Type Size(bytes) Range int or signed int 2 -32,768 to 32767 unsigned int 2 0 to 65535 short int or signed short int 1 -128 to 127 unsigned short int 1 0 to 255 long int or signed long int 4 -2,147,483,648 to 2,147,483,647 unsigned long int 4 0 to 4,294,967,295 FLOAT TYPE DATA TYPE Float type data types are used to store a real number. Type Size(bytes) Range Float 4 3.4E-38 to 3.4E+38 double 8 1.7E-308 to 1.7E+308 long double 10 3.4E-4932 to 1.1E+4932 CHARACTER DATA TYPE Character type data type is used to store Character type value ...

Variable: Declaration, initialization and Usage

Variable Variables are the names given to some memory location where a value is stored; the variable is corresponding to the data or value input in it. RULES FOR DEFINING A VARIABLE / VARIABLE NAME: · A Variable name should not have name of any KEYWORDS in C. · A Variable name can be alphanumeric but should start with an Alphabet. · A Variable name should not consist of any special symbol other than “_” Underscore Symbol.  · A Variable should be defined before using it. VARIABLE DECLARATION: In this step, the variables are declared, this steps always occurs before using the variables. FORMAT:   EXAMPLE: VARIABLE INITIALIZATION: Providing a Value to any variable is called initialization. INITIALIZATION AT THE TIME OF DECLARATION: The variable can be given its value at the time of declaration. USAGE OF VARIABLE: Here is the example, to show how a vari...