How to write the code of the program to swap two numbers
with in one statement?
Answers were Sorted based on User's Feedback
Answer / rajitha
#include<stdio.h>
main()
{
int a=3,b=4;
b=a+b-(a=b);
printf("%d",a);
printf("%d",b);
}
| Is This Answer Correct ? | 19 Yes | 4 No |
Answer / manoj kumar shukla
main()
{
int a=4,b=3;
a=a+b-(b=a);
printf("%d",a);
printf("%d",b);
}
| Is This Answer Correct ? | 6 Yes | 2 No |
What is the need of structure in c?
How can my program discover the complete pathname to the executable from which it was invoked?
What are all different types of pointers in c?
What is meant by recursion?
What is malloc calloc and realloc in c?
Does * p ++ increment p or what it points to?
#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?
fn f(x) { if(x<=0) return; else f(x-1)+x; }
What is the general form of #line preprocessor?
program to find the second largest word in a paragraph amongst all words that repeat more thn twice
Where are the auto variables stored?
Are local variables initialized to zero by default in c?