HTML

Preprocessor:
  • A preprocessor is a software program that process the source file before sendin to actual compilation is called preprocessor.
  • Preprocessing is the first step of the language processing..
  • While precessing the source file, the preprocessor replaces header files and macrons   with defined files and values.


                             

It mostly performs three tasks.
1.It removes comments
2.File inclusion.
3.Macro expansion

Header files:

A header file is a file with extension .h which contains c function declaration and macro definitions to be shared between several files.
 we have several types of header files.
          <assert.h>: Program assertion function.
          <ctype.h>: Character type function.
          <locale.h>: Localization function.
          <math.h>: Mathematics function
          <Sethmp.h>: Jump functions.
          <signal.h>: Signal handling function.
          <stdarg.h>: variable arguments handling functions
          <stdlib.h>: Standard input and output function.
          <stdlib.h>: Standard utility function.
          <string.h>: String handling function 
          <time.h>: Date time function.
 Task:


Output


Variables and Datatypes in c:


Variable:

  •  A variable is nothing but a field which is used to store the data.
  •  Keywords are not allowed while declaring a variable
  •  C is case sensitive so upper and lower alphabets are treated as different.
  •  A variable name can consists of alphabets, numbers and the underscore.
  •  The variable name can not start with a number.
  • Variable declaration refers to the part where a variable is first declared before its first use.
  • Variable definition is the part where a variable is assigned to the memory location and to the value.
These are two types:
    1.Local variable
    2.Global variable

1.Local variable:

   The scope of local variable is with in that block or function.
    Local variables are must always declared at the top of the block.
    When the compiler encounters the closing brace the local variable is ends.
 2.Global variable:
    Global variable is defined at the top of program.
     It's scope is through out the program.
     These values can be modified by the any function.
Datatypes:
 Datatypes determine the type of data of a variable will hold.
 Each variable in c has an associated data type.
 Each data type requires different types of memory.
C language supports 2 types of datatypes.
1.Primary datatpes:
     These are fundamental datatypes in c like int, char,float
2.Derived datatpes:
 These are nothing but primary data types but grouuped like array, structure, unon and pointer.

 1.Integer Datatypes:
   These are used to store numerical values
    We can not store decimal values.
   These are short,int,long
 2. Character Datatypes:
     These are used to store character value.
      These are char and unsigned char
3. Floating Datatypes:
   These are used to store decimal values.
    These are float,double,long double.
4. Void Datatypes:
   It means no value.
   It is used to specify the type of functions which returns no value.
 Ex:

Output

Task-1:
Strcat: The Strcat() function takes two arguments.1)Dest 2)Source.
It will append the copy of the source string into the destination string.


Output


Operators:

An operator is a symbol which operates on value or a variable.
C has wide range of operators to perform operations.
1. Arithmetic operators(+,-,*,/,%)
2. Relational operators(==,!=,>,<,>=,<=)

3. Logical operators(&&,||)
4. Bitwise operators(&,|,^,~,>>,<<)
5. Assignment operators:(=,+=,-=,*=)
Task-1:

Output

Task-2:

Output-1:

Output-2: