1.

Consider the C program below. What does it print?# include <stdio.h># define swapl (a, b) tmp = a; a = b; b = tmpvoid swap2 ( int a, int b){int tmp;tmp = a; a = b; b = tmp;}void swap3 (int*a, int*b){int tmp;tmp = *a; *a = *b; *b = tmp;}int main (){int num1 = 5, num2 = 4, tmp;if (num1 < num2) {swap1 (num1, num2);}if (num1 < num2) {swap2 (num1 + 1, num2);}if (num1 >= num2) {swap3 (&num1, &num2);}printf ("%d, %d", num1, num2);}/* Add code here. Remove these lines if not writing code */(A) 5, 5(B) 5, 4(C) 4, 5(D) 4, 4

Answer»


Discussion

No Comment Found

Related InterviewSolutions