UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I use the increment (++) and decrement (--) operators in C++?

Asked by Last Modified  

Follow 3
Answer

Please enter your answer

Experienced Computer trainer having worked in IT sector for 20 years.

the increment operator ++ increases the value of a variable by 1. Similarly, the decrement operator -- decreases the value of a variable by 1. However, there is an important difference when these two operators are used as a prefix and a postfix.
Comments

IT Professional Trainer with 12 years of experience in IT Industry

Here's how you use the increment (++) and decrement (--) operators in C++: Increment operator: The increment operator (++) increases the value of a variable by 1. Syntax:variable++ Example:int a = 10;a++; // Now a = 11 Decrement operator: The decrement operator (--) decreases the value of a variable...
read more

Here's how you use the increment (++) and decrement (--) operators in C++:

Increment operator: The increment operator (++) increases the value of a variable by 1.

Syntax:
variable++

Example:
int a = 10;
a++; // Now a = 11

Decrement operator: The decrement operator (--) decreases the value of a variable by 1.

Syntax:
variable--

Example:
int a = 10;
a--; // Now a = 9

The increment and decrement operators can be used in a variety of ways, such as in for loops, while loops, and conditional statements. They can also be used to modify the values of variables.

read less
Comments

Related Questions

Which language is best, C, C++, Python or Java?
If you want to learn any languages C#, Java, ect. then must to learn C, C++ language as these are base or language to be strong in language skills. C++ is improved version of C language. C#, Java, J# and etc. which are improved version of C++.
Sribaghya
0 0
6
what is method over-riding and how it is used ? if possible send with code with output or screen photo ?
Method over-riding : it is a technique in which more then one function with same name and same signature( similar type parameter) can present in program. in overriding a subclass method overrides the definition...
Sayyad
0 0
5
What is the syntex error?
A syntax error is a violation of the syntax, or grammatical rules, of a natural language or a programming language. ... A syntax error is called a fatal compilation error, because the compiler cannot translate...
Pranik
Explain about protected internal access specifier?
protected access specifier is used in inheritance. Base class members are made accessible to its sub classes through protected access specifier. This access specifier works with in inheritance.
Sahiba
0 0
7
What is different between malloc and calloc?
The Diffrences are like-- malloc() takes a single argument (memory required in bytes), while calloc() needs two arguments. Secondly, malloc() does not initialize the memory allocated, while calloc() initializes...
Roopali

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Compiler vs Interpreter
Compiler Interpreter Convert all the code into binary format and execute. Convert one statement at a time and execute, then Convert next statement and execute. After conversion, source...

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

Copy-on-Write
Note: You can read the original write-up at http://som-itsolutions.blogspot.in/2017/01/copy-on-write.html As i was trying to recapitulate several important concepts of OOAD, naturally COW or Copy-On-Write...

Lets learn why OOPS is popular?
1. Supports reusability- It means that once a class is designed it works just like a template which can be inherited. 2. Provides better management- It means that abstract classes and interfaces guide...
R

Memory Layout in C++ vis-a-vis Polymorphism and Padding bits.
I know there is no need for the knowledge of memory layout for a normal day-to-day development of C++. However, when someone goes in the bit/byte level of C++, he needs to look for such discussion. To...

Recommended Articles

Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for C++ Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more