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);
}
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 |
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
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']
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }
WAP to display 1,2,3,4,5........N
How to return multiple values from a function?
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); }
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 *)); }
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
find A^B using Recursive function
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }