Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Information Technology > Programming Languages > C

C C Interview Questions, Learn by sharing C Interview Questions asked in various companies, Get Career advices, Interview Procedures from C experts, Post asked C Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-02-2008, 11:46 AM
Senior Member
 
Join Date: Feb 2008
Posts: 9,095
Default What does a+++++b mean

What does a+++++b mean ?
Reply With Quote
  #2 (permalink)  
Old 04-27-2008, 02:32 PM
Junior Member
 
Join Date: Apr 2008
Posts: 4
Default

its a compilation error..
Reply With Quote
  #3 (permalink)  
Old 04-28-2008, 07:56 AM
Junior Member
 
Join Date: Apr 2008
Posts: 3
Default lvalue

yeah compilation error...
gives an error "lvalue required in main "
Reply With Quote
  #4 (permalink)  
Old 05-29-2008, 08:38 AM
Junior Member
 
Join Date: May 2008
Posts: 2
Default

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....
Reply With Quote
  #5 (permalink)  
Old 06-28-2008, 04:00 PM
Junior Member
 
Join Date: Jun 2008
Posts: 3
Default

statement is invalid
Reply With Quote
  #6 (permalink)  
Old 07-07-2008, 05:36 PM
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
  #7 (permalink)  
Old 07-10-2008, 04:49 AM
Junior Member
 
Join Date: Jul 2008
Posts: 7
Default a+++++b

(a++) + (++b)
the var' a is post incremented and b is preincremented
Reply With Quote
  #8 (permalink)  
Old 07-11-2008, 11:07 AM
Junior Member
 
Join Date: Jul 2008
Posts: 5
Default

a++ is the post increment and ++b is the pre increment and hence the result will be 9...
Reply With Quote
  #9 (permalink)  
Old 07-24-2008, 05:36 AM
Junior Member
 
Join Date: Jul 2008
Posts: 1
Default

Is evaluated as (a++) + (++b).
U can verify it using "Let us c" by "Yashwanth Kaneethkar"
Reply With Quote
Reply

Tags
c language, interview questions

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On