A Place for Latest Exam wise Questions, Videos, Previous Year Papers, Study Stuff for MCA Examinations - NIMCET
Previous Year Question (PYQs)
2
What is the output of the following program?
#include
int main()
{
int i = 100, j = 300, k;
j = i ^ j;
i = i ^ j;
j = i ^ j;
printf("The values of i and j are %d, %d", i, j);
return 0;
}
Solution
This is the XOR swap technique.
After execution, values of i and j are swapped.
So output is 300, 100.
Online Test Series, Information About Examination, Syllabus, Notification and More.