Made by yash Chauhan
Notes oN c …
LOW LEVEL LANGUAGE
this is that type of language which is very easily understandable by the
computer, it includes 0 and 1 with in special symbols in some cases.
Low level language is of two types
Machine language
Assembly language
Machine language:
In machine language 0 and 1 is used which is very easy and understood
by the computer we use 0 and 1 to give instruction to the computer in this
language we don’t need any translator to translate.
Assembly language:
In assembly language 0 and 1 is used with special types of symbols such
as +,-,* etc to perform an specific task, an translator is needed to translate
this language.
The translator converts the assembly language to the machine language.
HIGH LEVEL LANGUAGE
This type of language cant be understand by the computer because it is
human language to translate this language to the computer language we use
translators.
TRANSLATORS
COMPILER INTERPRETER ASSEMBLER
C TOKENS
This is the smallest individual unit in c language . it is the basic
component in the source code.
Keywords
Identifiers
String
Constant
Operators
Special symbols
Keywords: keyword are the predefined functions in the c language which
perform the specific task .There are 32 keywords in the c language ,we
can’t change keyword as they are stored in predefined libraries .
compiler already knows the meaning of these programs
Identifiers: identifiers are those whose are given to a variable or array
or group of variables to identify them in main program.
Eg int a ;
Here a is an identifier in this example .
Rules:
1st character should be an alphabet or underscore succeeding character
might be letters or numbers.
Identifiers should not be keywords.
Constant:
Constant are those whose values does not change in c language in the
main program.
For example : int a=78;
Here a is now a constant with the value of 78.
String:
string is defined as the arranged group of characters in c language.
Eg”yash Chauhan” is a example of string.
Operators : operators are those which are used to perform an specific
logical task on the operands and the variables.
Special symbols: there are many types of special symbols in c language
some are the part of function syntax and some have their own status and
work .
For eg, ( ),{ ]<[]>
ELEMENTS IN C LANGUAGE
Headerfiles
Main function
Code lines inside the main function
Statements
Semicolon
Variables
fuctions
PREPROCESSOR DIRECTIVE:
These lines start with the # symbol which tells the preprocessor to
inject the code in the source file which user has included or defined
in it preprocessor line start before the compiler….
FUNCTIONS:
Functions are those which have some collection of statement of a
specific task to perform,
Eg, division ,modular division, remainder program.
VARIABLES:
Variables are those which are used in c language to store values in
it ,a variable defined the location name we can put values in
variables .
Eg int b;
b is a variable .
variables
global
Local
these are those
which are declared which are declared
inside the main
outside the main
function
funciton
STATEMENT :
An statement is an command which is used to instruct computer for
performing an specific action in the c language.
HEADER FILES:
Header files are those files which are included before the main
function these files contains the definitions of some keywords which
are already coded and defined in this header files .
File containing c declarations and macro definations which is
to be declared between
Several source files.
SEMICOLON:
Semicolon is used in c language to terminate a statement or code
line or function;
c language
elements c tokens
keywords,string,constant,operato
processor directives rs
functions,variables special symbols
statement ,headerfiles,semicolon identifiers
MULTIPLICATION TABLE PROGRAM FOR THE C LANGUAGE:
Operators:
Operators are those special symbols which perform operations on
the operands it means the operators operate their functions on
variables.
Types of operators
!Arthimetic operators:
These operators are used for performing arthimetic operations on
the variables In the function.
For example:addition ,subtraction etc;
2.relational operators;
Those operators which are used to compare values of variables or
operands
Or relation can also be shown by these operators.
For example:a>=b,a>3,b>a,etc;
3.logical operators;
These operators are used to perform some logical operations .
And logical operator
It states that if any condition of these following statements are false
then the entire statement is incorrect.
For examples; (a>b)&&(x==3)&&(c<d)
Or logical operator
(a<=n)||(a<b)||(x==10)
In this above example there is no compulsiness to true if at least one
condition will true then the complete statement would true.
Logical not operator:
In this results are reversed .
Assignment operators:
assignment operators are used to assign and put values in variables
or in condition to check wheather the variables is equal to other
quantities or not.
Increment or decrement operators
(i++),(i--)
In the increment or decrement operators the value of the variables
can be increased or decreased by one .
Special operators
in c language there are some special operators which have different
use in the program for eg..{},<>,”:”;, etc..
conditional operators:
it uses three expressions to execute 1 st is condition and second and
third are cases.
For eg. If(n%2==0)?printf(“number is even”):printf(“odd number”);
Here if remainder is zero then first case will execute otherwise
second will execute.
ARRAYS
Arrays can be defined as the collection of variables of same type
which can be arranged in order.
All arrays have definite name in the variable declared by user and
their positions can be defined by the size of array taken by the user.
Length of array
= uperbond – lower bond +1
Size of array:
No of array blocks*size of one block
Looping :
Looping is the method of ;
Execution of statement or a block of statement repeateadly in a
function is called the looping..
In looping the execution depands on the condition provided by user
If the condition would satisfied and found true after checking the
statement will execute again and again till the condition doesn’t get
false.
There are three loops used
1.For(initialize : condition :increment or decrement)
2while(condition) //if true then the statement will execute inside
the semicolon
{
Statements………
Increment or decrement operator;
}
3.do{
Statements.. //important excute one time then condition checks
and process run
}
Recursion:
it is defined as the technique in c language where the function call
itself .
a fuction that calls itself in the function is called recursive function.
By the use of recursion we can also create fabonacci series program which
has great importance in field of mathematics.
PASSING PARAMETERS AND CALL BY VALUE AND CALL BY REFERENCE
we have only two parameters or argument passing technique available..
1 call by reference
2 call by value
In call by reference the address of value is passed so there is no need to return
a value to the main function because by adreess operator arguments the other
variable can access the values of other functions..
In the call by value only the actual copy of value of variables are passed in
the form of arguments.
Such that the called function can’t access the calling function values so we
can return values in it. By using return.
SWITCH CASE STATEMENTS;
It is used in clanguage to provide choice to user to execute a specific statement
in block of switch;
An another variable is declared for choosing the cases in the switch block.
WE CAN DECLARE FUNCTIONS INSIDE OR OUTSIDE THE MAIN FUNCTION
CALLED LOCAL AND GLOBAL VARIABLES.
FOR DECLARING
NO ARGUMENT NO RETURN VALUE
For example void sum()
NO ARGUMENT BUT RETURN VALUE
Int sum ();
ARGUMENT BUT NO RETURN VALUE
Void sum(int);
Note: if we pass one or more arguments this can be continued by adding
comma after first variables and two or more variables can be passed by
this .
For example
Void multiply(int ,int ,int);
ARGUMENT WITH RETURN VALUE
Int sum(int)
NOTE::
I am not making program of square root because it is not clear in the
question wheather it would be made by recursion or not(working on
that)
If you got bad marks I wont be responsible for
that this Is for only those who want to understand concept in easy
language
if some topics are missing in it because they are easy and understandable
topics which I don’t think need to be added in this document
good luck..