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...

sunil


{ City } hyd
< Country > india
* Profession * student
User No # 41629
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 21
Users Marked my Answers as Wrong # 8
Questions / { sunil }
Questions Answers Category Views Company eMail




Answers / { sunil }

Question { Focus, 191656 }

write a program to swap Two numbers without using temp variable.


Answer

four Types with single statements:

1.b=(a+b)-(a=b);

2.a^=b^=a^=b;

3.a=a+b;
b=a-b;
a=a-b;

4.a=a*b;
b=a/b;
a=a/b;


rohanraju143@gmail.com from NIT Waramgal

Is This Answer Correct ?    18 Yes 7 No

Question { 25230 }

WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW
IT COME ..

#include
#include
void main()
{
int k=20;
printf("%d%d%d%d",k,k++,++k,k);
getch();
}


Answer

answer is

22 21 21 20

printf .. executes from left hand side..


so first ..

printf("$d %d %d %d",k,K++,++k,k);

4.last k ie; 20
3.++k (pre) : 21
2.k++ (post) : 21 and then increamented
1.k : 22

answer is : 22 21 21 20

Is This Answer Correct ?    3 Yes 1 No