CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
void main ()
{
int x = 10;
printf ("x = %d, y = %d", x,--x++);
}



Category C Interview Questions
Rating (4.0) By 2 users
Added on 7/18/2006
Views 775
Rate it!
Answers:

Ans: Lvalue required..

it will print first value .but in second value it will perform preincrement operater which will result as a int value but we can't postincrement that value,we can postincrement variable.so it requires a variable to store that value so it gives Lvalue required error.



This snippet will print x=11,y=10 because the arguments passed to a function are calculated first and the order is from right to left. So value of x and y is 11 and 10



 Posted by: Anish    

Contact Anish  Contact Anish


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
main()
{
char c;
int i = 456;
clrscr();
c = i;
printf("%d", c);
}


View Answer
main()
{
int c = 5;
printf("%d", main||c);
}


View Answer
main()
{
int i = 100;
clrscr();
printf("%d", sizeof(sizeof(i)));
}


View Answer
main()
{
printf("%d, %d", sizeof('c'), sizeof(100));
}


View Answer
void func1(int (*a)[10])
{
printf("Ok it works");
}
void func2(int a[][10])
{
printf("Will this work?");
}

main()
{
int a[10][10];
func1(a);
func2(a);
}


View Answer
main()
{
char *a = "Hello ";
char *b = "World";
clrscr();
printf("%s", strcpy(a,b));
}


View Answer
main()
{
char *a = "Hello ";
char *b = "World";
clrscr();
printf("%s", strcat(a,b));
}


View Answer
struct Foo
{
char *pName;
char *pAddress;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
obj->pName = malloc(100);
obj->pAddress = malloc(100);
strcpy(obj->pName,"Your Name");
strcpy(obj->pAddress, "Your Address");
free(obj);
printf("%s", obj->pName);
printf("%s", obj->pAddress);
}


View Answer
struct Foo
{
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}


View Answer
const int perplexed = 2;
#define perplexed 3
main()
{
#ifdef perplexed
#undef perplexed
#define perplexed 4
#endif
printf("%d",perplexed);
}


View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6001/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.89