πŸ“Š C Programming
Q. What will be the output of the following code snippet?
Code:
#include <stdio.h>
void swap(int *a, int *b) {
    int t = *a;
    *a = *b;
    *b = t;
}
void solve() {
    int a = 3, b = 5;
    swap(&a, &b);
    printf("%d %d", a, b);
}
int main() {
	solve();
	return 0;
}
  • (A) 3 5
  • (B) 5 3
  • (C) 5 5
  • (D) 3 3
πŸ’¬ Discuss
βœ… Correct Answer: (B) 5 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
254
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Manisha Agrawal
Publisher
πŸ“ˆ
86%
Success Rate