Tuesday, April 12, 2016

C programming Language Code Examples-ControlStatement-IfElse(6)

Smiley face

Code:

Smiley face

Output:

Smiley face
Smiley face

note:

this is wrong to fix it see next code

Code:

Smiley face

Output:

Smiley face
Smiley face

note:

'{}' -curly braces used with 'if' & 'else' statement

but if you want to do only 1 line no need

other wise should use the braces.


Logical Operations

&& - AND

|| - OR

! - NOT

Code:

Smiley face

Output:

Smiley face

note:

this is a wrong one so you can use 'else if'

to fix it

Code:

Smiley face

Output:

Smiley face

No comments:

Post a Comment

Wel Come !!! computer express