csc141 gdb
DESCRIPTION
presentationTRANSCRIPT
![Page 1: csc141 GDB](https://reader035.vdocument.in/reader035/viewer/2022081811/563db7d8550346aa9a8e7971/html5/thumbnails/1.jpg)
COMSATS Institute of Information Technology (Virtual Campus)
Block F, NISTE Building, H-8/1 Islamabad Pakistan
INTRODCUTION TO COMPUTER PROGRAMMING( CSC 141)
GDB 01
What is functionality of increment (++) operator?
Answer:
SPECIAL OPERATOR: ++
Increment (++) is the value of variable before or after its value is used in an
expression.
Symbol Example Operation
++ x++ Increment after (Post increment)
++ ++x Increment before (Pre increment)
Examples Using ++
Example-1:
int x = 4;
y = x++;
printf ( “X = %d \t “Y = %d “, x, y )
will print X = 5 Y = 4
as x is incremented after assignment operation.
Example-2:
x = 4;
y = ++x;
printf ( “X = %d \t “Y = %d “, x, y )
will print X = 5 Y = 5
as x is incremented before assignment operation.
CSC271 Database Systems