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

How can I trap or ignore keyboard interrupts like control-c?

1063


What are the functions to open and close file in c language?

1201


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

1044


Write a program to check prime number in c programming?

1088


Why is main function so important?

1101


Explain the advantages and disadvantages of macros.

1096


What are the scope of static variables?

1182


What is string in c language?

1147


What is the condition that is applied with ?: Operator?

1127


What is the difference between the local variable and global variable in c?

962


Difference between MAC vs. IP Addressing

1145


What is break in c?

1024


How do we make a global variable accessible across files? Explain the extern keyword?

1877


Why n++ execute faster than n+1 ?

2990


What is omp_num_threads?

1077