Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Programming

Similar presentations


Presentation on theme: "Introduction to Programming"— Presentation transcript:

1 Introduction to Programming
Lecture 22 Review

2 Bit wise Manipulation and Assignment Operator

3 a = a + 1 ; a += 1 ;

4 Bit Manipulation Operators
&= Bitwise AND Assignment Operator |= Bitwise OR Assignment Operator ^= Bitwise Exclusive OR Assignment Operator

5 Assignment Operator a &= b ; Same as a = a & b ;

6 Assignment Operator a |= b ; Same as a = a | b ;

7 Assignment Operator a ^= b ; Same as a = a ^ b ;

8 Design Recipes PAY ATTENTION TO DETAIL
Analyze a problem statement, typically expressed as a word problem Express its essence, abstractly and with examples Formulate statements and comments in a precise language Evaluate and revise the activities in the light of checks and tests. PAY ATTENTION TO DETAIL

9 Variables

10 Symbolic Names x i BasicPay HouseRent

11 Data types Whole numbers: Real Numbers (with decimal points)
int, short, long, unsigned Real Numbers (with decimal points) float, double Character data char

12 int = 4 bytes char = 1 byte

13 ASCII Table

14 Arrays Collection of same data types

15 Arithmetic Operators Plus + Minus - Multiply * Divide / Modulus %

16 Modulus Operator a % b ; 7 % 2 = 1 ; 100 % 20 = 0 ;

17 Compound Arithmetic Operators
+= -= *= /= %=

18 Compound Arithmetic Operators
a = a + b ; a += b ;

19 Logical Operators AND && OR ||

20 a < b ; a <= b ; a == b ; a >= b ; a > b ;
Comparison Operators a < b ; a <= b ; a == b ; a >= b ; a > b ;

21 a = b;

22 if ( a = b ) //Wrong //Logical Error

23 a > b ; a >= b ;

24 Bit wise Operators Bit wise AND & (Binary) Bit wise OR | (Binary)
Bit wise Exclusive OR ^ (Binary) NOT ~ (unary)

25 Sequential Construct Decision Construct Loop Construct

26 If-statement if ( condition ) { statement ( s ) ; }

27 If-else if ( condition ) { statement ( s ) ; } else

28 if ( a > b && c < d )

29 Nested if statements

30 if ( condition ) { statement ( s ) ; }

31 While Loops while ( a > b ) { statement ( s ) ; }

32 While Loops While loop executes zero or more times

33 Do - while do { statement ( s ) ; } while ( condition ) ;

34 Do-while loop executes
one or more times

35 For Loops for ( i = 0 ; i < 10 ; i ++ ; ) { statement ( s ) ; }

36 i = i + 1 ; i += 1 ; i ++ ;

37 Switch Statement

38 break ; continue ;

39 Functions

40 Call by value Call by reference

41 Arrays

42 Arrays int a [ 10 ] ; a [ 0 ] ; : a [ 9 ] ;

43 Pointers

44 Memory address of a variable is stored inside a pointer
Pointers Memory address of a variable is stored inside a pointer

45 Files and their Input / Output systems


Download ppt "Introduction to Programming"

Similar presentations


Ads by Google