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() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }
how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.
19 Answers Cap Gemini, Infosys,
What is data _null_? ,Explain with code when u need to use it in data step programming ?
What is the hidden bug with the following statement? assert(val++ != 0);
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?
main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }
Finding a number multiplication of 8 with out using arithmetic operator
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
main() { char a[4]="HELLO"; printf("%s",a); }
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?