Computer Science, asked by leelavatidevadiga456, 10 months ago

What will be the output? #include
void swap(int a,int b)
{
int temp;
temp=a;
a=b;
b=temp;
}
int main()
{
int num 1=10,num2=20;
printf("before swapping num 1=%d num 2=%d\n",num 1,num 2);
swap(num 1,num 2);
printf("after swapping num 1=%d num 2=%d\n",num 1,num 2);
return 0;
}
a)before swapping num1=10 num 2=20 after swapping num 1=10 num 2=20 b)before swapping num 1=10 num 2=20 after swapping num 1=20 num 2=10 c)before swapping num 1=10 num 2=20 after swapping num 1=20 num 2=20 d)before swapping num 1=10 num 2=20 after swapping num1=10 num2=10

Answers

Answered by Anonymous
1

before swapping num1=10 num2=20after swapping num1=20 num2=10

Similar questions