Professional Documents
Culture Documents
Cppsyntaxsumggggmary 110831213750 Phpapp02
Cppsyntaxsumggggmary 110831213750 Phpapp02
expression
statement ) (
expression
....... :
)
(....... :
; cout << x
12+14
;A=A+1
)while (true
Statement
hello world
{
;"cout << "222
}
A+ b / c
138
) ) sin( x+3 )* f( g( y
expressions
expression
literal
15
hello world
183
assignment
expression
B=5
variable
A= B = 5
) B 5
A 5 (B
expression
function
; )( void Greeting
)( void main
main
.......
{
;)(Greeting
}
.....
main
)( void Greeting
{
;cout << yahla
}
ASCII
!! q
)if (true
{
....
}
}while(15) {....
)'if ('q
{
....
}
)if (0
{
.....
}
}while ( false ) {....
}if (48-48) {....
If
if statement
if expression
x=a ? b : c ;
?
: c b
Max = (a>b) ? a : b ;
if ( choice==5)
{
cout << the result is <<x ;
}
if ( done )
return 0 ;
if (a==b)
While loops
1.
Condition 0
false
)( while
while
.2 condition
:
09
;int x = 0
) while ( x < 10
; {cout <<x
; x++
}
function test
) )(while ( test
} ;) ({ DoJob
. while
) ( 1
condition
.
code
statement
!!! code
while !
) while( A>B
B++
; )while ( x<10
;x++
for loops
) ; ; ( for
.1 for .
) ; ; ( for
code
infinite loop
;cout <<hi
}
.2 for
while
:
)for ( ; ;
}{code
;
) while(
{
code
10
) (
;cout << i
statements
statement
;cout << 5
} ;{ int x= 5, y = 6