Join our Telegram Channel

8000+ STATIC GK MCQs for SSC/ Railway/ PSC
1000 POLITICAL SCIENCE MCQS | EBook
Get 22 nos. GK EBooks | Combo Pack
Current Affairs Monthly Magazine -Subscribe Now!
1000 BIOLOGY MCQS AND ANSWERS | EBook
1000 ECONOMICS MCQS FOR EXAMS | EBook
Mughal Empire MCQs | EBook
ECONOMIC GEOGRAPHY MCQs | EBook
350 MCQs ON INDIAN CONSTITUTION | EBook

Question

What is the output of the following code?

	main()
	{
		int a=1, b=10;
		swap(a,b);
		printf("\n%d%d", a,b);
	}
	swap(int x, int y)
	{
		int temp;
		temp=x;
		x=y;
		y=temp;
	}
	
A 1 1
B 1 10
C 10 1
D None of these
Answer & Explanation
Option: [B]

The 'call by value' method is applied in this program. Here the data is passed by value in the main(). So the variables are not changed.

Advertisement
Advertisement

General Knowledge

Month-wise Current Affairs 2022

Category-wise Current Affairs

Jobs by Qualification

Free Mock Test