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:-

Online c compiler


Download pdf notes







Comments

Popular posts from this blog

Develop and execute C Program to Add Two Distances given in kilometer-meter Using Structures.

Develop a c program to find the sum of all elements stored in a given array using a pointer.