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 |
write a program in c to merge two array
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
main() { 41printf("%p",main); }8
how to check whether a linked list is circular.
main() { char a[4]="HELL"; printf("%s",a); }
main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513
3 Answers HCL, Logical Computers,
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }
Printf can be implemented by using __________ list.
Derive expression for converting RGB color parameters to HSV values
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }