Q. What will be the output of the following code snippet?

Code:
#include <stdio.h>
void solve() {
    int first = 10, second = 20;
    int third = first + second;
    {
        int third = second - first;
        printf("%d ", third);
    }
    printf("%d", third);
}
int main() {
	solve();
	return 0;
}
  • (A) 10 30
  • (B) 30 10
  • (C) 10 20
  • (D) 20 10
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10 30

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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