Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Give the logic for this

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a=10,b;
b=++a + ++a;
printf("%d", b);
getch();
}
Output: 24......How?

Answers were Sorted based on User's Feedback



Give the logic for this #include<stdio.h> #include<conio.h> void main() { clrscr..

Answer / suman halder

++a is an unary expression which signifies pre-increment operation...so ,pre-increment will be evaluated before the binary operation takes place..
b=++a + ++a;
here,a will be incremented twice and then binary operation is performed...
so,
b=12+12 which produces 24...

Is This Answer Correct ?    6 Yes 3 No

Give the logic for this #include<stdio.h> #include<conio.h> void main() { clrscr..

Answer / krishnaraogm

in first increment the a will become 11. And the second
increment the a will become 12. b=++a + ++a ; have same
variable so b=12+12=24

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More C Interview Questions

How are portions of a program disabled in demo versions?

0 Answers  


Why is sizeof () an operator and not a function?

0 Answers  


What is sizeof return in c?

0 Answers  


What is union in c?

0 Answers  


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

0 Answers   Genpact,


logic for x=y^n

1 Answers   Delphi,


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

0 Answers   Amazon,


Why c language?

0 Answers  


What is difference between stdio h and conio h?

0 Answers  


write a program in reverse the string without using pointer,array,global variable declaration,lib fun only using a function?

5 Answers   HCL,


What are logical errors and how does it differ from syntax errors?

0 Answers  


What is variable and explain rules to declare variable in c?

0 Answers  


Categories