#define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}
what are the outputs?
Answer Posted / goodhunter
10 5
10 5
| Is This Answer Correct ? | 20 Yes | 2 No |
Post New Answer View All Answers
When should a type cast not be used?
What is difference between structure and union in c?
What is the hardest programming language?
What is memory leak in c?
Can you please explain the difference between strcpy() and memcpy() function?
What is difference between structure and union in c programming?
Does free set pointer to null?
Who is the main contributor in designing the c language after dennis ritchie?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
Write a program to check palindrome number in c programming?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
How would you obtain the current time and difference between two times?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
Write a code to remove duplicates in a string.
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none