Binary
By the term binary we want to say two numbers viz zero(0) or one(1).
Computer reads all the input given to it in form of Zero's and One.
All the keys are given numbers from 0-11111111(i.e. 0 to 255).
We convert a given number into its binary equivalent by dividing it continously by 2 and noting the remainder each time.
For Example
0=0
2=0000 0010
4=0000 0100
5=0000 0101
6=0000 0110
8=0000 1000
We can convert a binary back to its equivalent by raising it in powers of 2 or by using the shortcut
0000 1000 = 128 *0 + 64*0 +32*0 +16*0 +8*1 +4*0+2*0+1*0= 8
Computer reads all the input given to it in form of Zero's and One.
All the keys are given numbers from 0-11111111(i.e. 0 to 255).
We convert a given number into its binary equivalent by dividing it continously by 2 and noting the remainder each time.
For Example
0=0
2=0000 0010
4=0000 0100
5=0000 0101
6=0000 0110
8=0000 1000
We can convert a binary back to its equivalent by raising it in powers of 2 or by using the shortcut
- number : 128_64_32_16_8_4_2_1
- place : 8 _ 7 _6 _5_4_3_2_1
0000 1000 = 128 *0 + 64*0 +32*0 +16*0 +8*1 +4*0+2*0+1*0= 8
Terms
What is Program?
A program is a piece of code which operates on certain variables and produce the required output
Psuedo Code
It is actually the whole code the only difference is that it does not contain the syntax i.e. a simple plain lines that complete a particular objective.
Algorithm
Certain logical steps which explain the working of a code.
Flowchart
A graphical format of an algorithm.
Identifiers
It is basically a name or any other thing,which is used to identfy any user defined item
Rules
Keywords
They are the predefined variables/identifiers which perform a definate logical operations.
eg. if, else ,for , while etc.
Comments
Whitespace
Any space or a blank space which separates one statement from the other
eg. int num1 i.e. it defines a variable num1 of type integer. space seperates num1 and integer so it is a whitespace...
Function
A program is a piece of code which operates on certain variables and produce the required output
Psuedo Code
It is actually the whole code the only difference is that it does not contain the syntax i.e. a simple plain lines that complete a particular objective.
Algorithm
Certain logical steps which explain the working of a code.
Flowchart
A graphical format of an algorithm.
Identifiers
It is basically a name or any other thing,which is used to identfy any user defined item
Rules
- They can start with any special character or any alphabet but not witha numeric character.
- They are case sensitive i.e. Num and num are two different variable/identifier.
- It would be appreciated that they are logical (like for 3 Numbers num1 , num2 num3 can be the variables instead of a,b,c).
Keywords
They are the predefined variables/identifiers which perform a definate logical operations.
eg. if, else ,for , while etc.
Comments
- They are the additional keyword which are provided by the programmer.
- They make the program easy to undersatand and read.
- Comment can be single line or multiple line .
- Their syntax is different in different languages.
Whitespace
Any space or a blank space which separates one statement from the other
eg. int num1 i.e. it defines a variable num1 of type integer. space seperates num1 and integer so it is a whitespace...
Function
- A Function can be defined as piece of code which performs a definate operation. A Program can have any number of function.
- A program must contain one function.
- Use of function is preferred as it reduces the lines of code.
- It has Three main parts which are
- Function prototype /definition
- Function call
- Function Body
- Method is just a function which is defined within a class.
- It is a temporary memory space while data is being moved from one memory space to another memory space.