Explain increment and decrement operators, C/C++ Programming

Assignment Help:

Increment and Decrement Operators.  

The operator for increment is '++' and decrement is '-'. These operators enhances or decrease the value of a variable on which they are operated, by one(1).  They can be used as prefix or postfix to the variable, and their meaning altersdepending on their usage. When used as prefix, the value of the variable is incremented/ decremented before using the expression. But when used as postfix, its value is first used and then the value is incremented or decremented.

e.g.

                --x;

                x--;

 

In the above example it does not matter whether the decrement operator is prefixed or suffixed. It will produce the similar result.

 


Related Discussions:- Explain increment and decrement operators

Basics, conceptual difference between big o,big thete and big omega

conceptual difference between big o,big thete and big omega

Software crisis, defining software crisis As the technology changes ra...

defining software crisis As the technology changes rapidly the requirement for the users' change, to part the growing demand of the user for trade,  business, and personal

COMPUTER, THEORY OF COMPUTER PROGRAMMING

THEORY OF COMPUTER PROGRAMMING

C language, in a program for what purpose print f and scan f is used

in a program for what purpose print f and scan f is used

Programming an odds betting website, Programming an odds betting website ...

Programming an odds betting website Project Description: We want someone to program a odds betting website, Require someone with experience and skills! Skills required are

Program to Find the Factorial of a Given Number, Program1: Write a progr...

Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene

Assignment, write a simple c++ program to that use the value to add five nu...

write a simple c++ program to that use the value to add five number .your program should prompt the user to enter these five numbers one after the other

C program to string compression, C program to string compression: Writ...

C program to string compression: Write a program to define a sting and all operations on string. void main()                                 {

C program for dynamic data structure(linked list), Aim: To implement a pro...

Aim: To implement a program for dynamic data structure(linked list). Code:                       class node {             int data;             node *next;

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd