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

What is return type in c?

0 Answers  


write a program to print calender using for loop.

1 Answers   HCL, TCS,


Can we change the value of static variable in c?

0 Answers  


what is pointer?

13 Answers   HCL, TCS,


What is getch c?

0 Answers  


How do I round numbers?

0 Answers  


how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");

9 Answers   TCS,


Write a program to print fibonacci series using recursion?

0 Answers  


what are the facialities provided by you after the selection of the student.

0 Answers   TCS,


What is typeof in c?

0 Answers  


any "C" function by default returns an a) int value b) float value c) char value d) a & b

0 Answers  


What is enumerated data type in c?

0 Answers  


Categories