Q. | void swap(int,int);
void main()
{
int a=10,b=15;
clrscr();
printf("Befor swap a=%d ,b=%d",a,b);
swap(a,b);
printf("\nAfter swap a=%d ,b=%d",a,b);
getch();
}
void swap(int a,int b)
{
int c;
c=a;
a=b;
b=c;
}
|
|||||||
|
Answer: | Option A | |
Explaination: | a and b are auto variable (default storage class is auto) .Here its scope is only within main function.After the main function both a and b will die.We are swapping outside the main function so value of a and b is not changing. |
Discussion
Your Comments Goes here... |
Name | Discussion |
---|