what is the difference between postfix and prefix unary
increment operators?

Answer Posted / tarun kumar

In prefix operator In postfix operator
#include<iostream.h> #include<iostream.h>
#include<coino.h> #include<coino.h>
void main() void main()
{ {
int i=10; int i=10;
int j=++i; int j=i++;
cout<<j; cout<<j;
getch(); getch();
} }
OUTPUT:11 OUPUT:10

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the right type to use for boolean values in c? Is there a standard type?

551


What is difference between union All statement and Union?

618


How can I dynamically allocate arrays?

581


Why do we use static in c?

625


Write a program with dynamically allocation of variable.

597






Write the Program to reverse a string using pointers.

609


What is the easiest sorting method to use?

625


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

677


the question is that what you have been doing all these periods (one year gap)

1610


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1253


Can a pointer be null?

552


what is the difference between 123 and 0123 in c?

707


What is a global variable in c?

582


Do you know pointer in c?

575


What are types of functions?

553