Conditional if / else
Harsh Khuha // C
What is if – else conditional statements?
The if-else statement is used to follow a certain set of instructions based on
the result of a decision.
Click to add text
" If the condition met is true, execute the true part.
But if the condition met is false, execute the false part."
Harsh Khuha // C
Basic Flow chart of if – else.
Boolean
if expression is TRUE if expression is FALSE
expression
Statement of true part Statement of false part
rest of the code Harsh Khuha // C
pseudocode.
Harsh Khuha // C
0 decide where to go
1 open the door
2 go out & check the weather
3 if it is raining
use umbrella
4 else
don't use umbrella
Harsh Khuha // C
0 pick up the phone book
1 open to start of the book
2 look for names
3 if harsh is among names
remove the contact
4 else if look for hidden contacts
go back to step 2
5 else
quit
Harsh Khuha // C
Syntax of if – else
if ( expression )
{
//execute of true part
}
else
{
//execute of false part
}
Harsh Khuha // C
pseudocode to source-code.
Harsh Khuha // C
if it is raining if ( weather==raining )
use umbrella {
else go_out_withUmbrella;
don't use umbrella }
else
{
go_out;
}
Harsh Khuha // C
Any Questions?
Harsh Khuha // C
OSI ( Open System Interconnect ).
Layer – 6. Presentation layer.
Harsh Khuha // Web
Layers at OSI Reference model.
7. Application Layer
6. Presentation Layer
5. Session Layer
4. Transport Layer
3. Network Layer
2. Data-link Layer
1. Physical Layer
Harsh Khuha // Web
What is presentation layer in OSI model?
The presentation layer gets its name from its purpose: it represents data to the Application
layer and is responsible for data translation and code formatting.
This includes extensions for e.g. like ".jpeg",".mp4",".txt","XML","html",.
Encryption and Decryption is also handled at this layer.
Data compression is handled at this layer.
Harsh Khuha // Web
A
Harsh Khuha // Web
65
Harsh Khuha // Web
ASCII
Harsh Khuha // Web
A B C D
65 66 67 68
Harsh Khuha // Web
72 73 33
Harsh Khuha // Web
72 73 33
H I
Harsh Khuha // Web
72 73 33
H I !
Harsh Khuha // Web
H I !
72 73 33
1001000 1001001 100001
Harsh Khuha // Web
Unicode
Harsh Khuha // Web
UTF-8
Harsh Khuha // Web
Harsh Khuha // Web
Harsh Khuha // Web
128514
Harsh Khuha // Web
11111011000000010
Harsh Khuha // Web
72 73 33
Harsh Khuha // Web
RGB
Harsh Khuha // Web
72 73 33
Harsh Khuha // Web
Harsh Khuha // Web
Harsh Khuha // Web
Harsh Khuha // Web
Harsh Khuha // Web
Harsh Khuha // Web
Any Questions?
Harsh Khuha // Web