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


int swap(int *a,int *b)

{

*a=*a+*b;*b=*a-*b;*a=*a-*b;

}

main()

{

int x=10,y=20;

swap(&x,&y);

printf("x= %d y = %d\n",x,y);

}



int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() ..

Answer / susie

Answer :

x = 20 y = 10

Explanation

This is one way of swapping two values. Simple checking will
help understand this.

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More C Code Interview Questions

main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


main() { int *j; { int i=10; j=&i; } printf("%d",*j); }

9 Answers   HCL, Wipro,


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

0 Answers  


void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }

2 Answers  


WAP to display 1,2,3,4,5........N

2 Answers  


How to return multiple values from a function?

7 Answers  


Write a function to find the depth of a binary tree.

13 Answers   Adobe, Amazon, EFI, Imagination Technologies,


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

1 Answers  


void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(“sizeof (int *) = %d \n”, sizeof(int *)); printf(“sizeof (double *) = %d \n”, sizeof(double *)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }

1 Answers  


void main() { int c; c=printf("Hello world"); printf("\n%d",c); }

2 Answers  


find A^B using Recursive function

2 Answers  


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


Categories