How many ways are there to swap two numbers without using
temporary variable? Give the each logic.
Answer Posted / chandan doki
void main()
{
int a,b;
printf("eneter any two values for a and b");
scanf("%d%d",&a,&b);
b=a+b;
a=b-a;
b=b-a;
printf("a=%d\nb=%d",a,b);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is pointers in c with example?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
In which layer of the network datastructure format change is done
Why are algorithms important in c program?
How can I get the current date or time of day in a c program?
What is string concatenation in c?
What is string constants?
What is the difference between procedural and declarative language?
Explain what is the best way to comment out a section of code that contains comments?
How do you use a pointer to a function?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
Can a program have two main functions?
What are static variables in c?
What are variables and it what way is it different from constants?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?