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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by a sequential access file?

1085


The __________ attribute is used to announce variables based on definitions of columns in a table?

1214


What is the meaning of typedef struct in c?

1072


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2262


What is the right way to use errno?

1060


How do you define CONSTANT in C?

1283


difference between object file and executable file

6733


Can a pointer point to null?

1071


How can you tell whether two strings are the same?

1258


What does main () mean in c?

1101


Do you know pointer in c?

1056


What does c value mean?

1202


List the variables are used for writing doubly linked list program.

2036


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1177


What is else if ladder?

1025