#include<stdio.h>
main()
{
int a=1;
int b=0;
b=++a + ++a;
printf("%d %d",a,b);
}

Answer Posted / vijay r15

ans 3 6

Let me explain
First a=1&b=0
b=++a + ++a;

The operation will be as
b= ++1 + ++a
=2 + ++a
=2 + ++2
=2 + 3=a+a now a=3
Remember here is the trick
Now b= a + a
I.e b=3+3=6

Got it

Vijay r15
For any clarification mail to
raj.vijay55@gmail.com

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are called c variables?

574


What is the use of putchar function?

649


What is #error and use of it?

681


Write a factorial program using C.

643


What is %d called in c?

757






What are the disadvantages of c language?

616


What is the purpose of realloc()?

667


How are 16- and 32-bit numbers stored?

721


What does typedef struct mean?

656


What are data types in c language?

580


What is a char in c?

552


What is keyword with example?

634


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1633


What is the benefit of using #define to declare a constant?

601


What does the message "automatic aggregate intialization is an ansi feature" mean?

694