retagged by
254 views
0 votes
0 votes

Consider the following $\text{C}$ program.

#include<stdio.h>
#define XOR(a, b)  (a) ^ (b)
void func (int *a, int *b)
{
    *a = XOR (*b, *a);
    *b = XOR (*a, *b);
    *a = XOR (*b, *a);
}

main()
{
    int a = 10, b = 20;
    func (&a , &b);
    printf(“%d %d \n”,a,b);
}

What will be the output of the program?

  1. $20 \; 10$
  2. $20 \; 20$
  3. $10 \; 10$
  4. $10 \; 20$
retagged by

Please log in or register to answer this question.

Answer:

Related questions

2 votes
2 votes
3 answers
2
admin asked Jan 5, 2019
423 views
What is the output of the following $\text{C}$ program?#include<stdio.h int main(void){ char s1[] = “Hello”; char s2[] = “World!”; s1 = s2; printf(“%s”,s1); }...