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 are local static variables?

0 Answers  


#include<conio.h> #include<stdio.h> void main() { int i; if(1,0,2,3) { printf("if"); } else { printf("else"); } getch(); } Can any body tell the answer of this question with explanation?

3 Answers   Huawei,


What is the difference between a function and a method in c?

0 Answers  


What is c basic?

0 Answers  


write a program to swap two numbers without using temporary variable?

3 Answers  


get any number as input except 1 and the output will be 1.without using operators,expressions,array,structure.don't print 1 in printf statement

3 Answers  


In the below code, how do you modify the value 'a' and print in the function. You'll be allowed to add code only inside the called function. main() { int a=5; function(); // no parameters should be passed } function() { /* add code here to modify the value of and print here */ }

1 Answers  


what will be maximum number of comparisons when number of elements are given?

0 Answers  


Program to find the sum of digits of a given number until the sum becomes a single digit

8 Answers   InterGraph,


What would be an example of a structure analogous to structure c?

0 Answers  


What are the types of data structures in c?

0 Answers  


What's the difference between calloc() and malloc()?

4 Answers  


Categories