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

Are enumerations really portable?

824


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2572


What are the application of c?

872


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

2199


What are the rules for the identifier?

930


How can I split up a string into whitespace-separated fields?

845


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

1042


Describe the modifier in c?

903


How do I determine whether a character is numeric, alphabetic, and so on?

909


How can you increase the allowable number of simultaneously open files?

859


Why c is a procedural language?

844


What is an lvalue?

869


What is #define in c?

848


What is extern keyword in c?

913


Write a program to swap two numbers without using a temporary variable?

899