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 meant by gets in c?

610


What language is windows 1.0 written?

576


How do I get a null pointer in my programs?

621


Explain how do you determine whether to use a stream function or a low-level function?

631


How can I generate floating-point random numbers?

610






What is array within structure?

588


Why do we use null pointer?

608


Do variables need to be initialized?

623


In which language linux is written?

606


What is the best style for code layout in c?

633


Why #include is used in c language?

602


Is the exit() function same as the return statement? Explain.

665


Which is better oop or procedural?

635


Explain what are header files and explain what are its uses in c programming?

629


Explain about the functions strcat() and strcmp()?

599