Write a program for pre and post decrement operators.
In this program we will see the use of decrement operator.
This post content:-
- Algorithm
- Flowchart
- C code
- Output
- Pdf notes
Algorithm:-
Step 1:-start.
Step 2:-declare the variables a, b, and c.
Step 3:-take the input for variable a.
Step 4:-assign variable b =--a (it is a pre decrement operator)
Step 5:-assign variable c =a--(it is a post decrement operator).
Step 6:-print b and c.
Step 7:-end.
Flowchart:-
C code:-
Output:-
Try it yourself:-
Comments
Post a Comment