View Single Post
  #6 (permalink)  
Old 07-07-2008, 06:36 PM
prabuhello prabuhello is offline
Junior Member
 
Join Date: Jul 2008
Posts: 19
Default

Quote:
Originally Posted by lav.hit View Post
if x=a+++++b ;
it will not give any error......
as a++ is preincremented value and ++b will be post increamented value......
suppose a=3;b=5;
then x will be 3+6=9....

hey, lav
x= a+++++b; It gives an error (Lvalue required in function main)
but
x= a++ + ++b; it works

example

#include
#include

int main()
{
int x,a=10,b=22;
clrscr();
x=a++ + ++b;
/* x=a+++++b; It gives error*/
printf("x=%d",x);
getch();
}
output:
x=33
Reply With Quote