write a program to swap Two numbers without using temp variable.
Answer Posted / biren
#include<stdio.h>
void main()
{
int a=2,b=3;
printf("before swap the value is:::");
printf("a=%d\tb=%d",a,b);
b=a+b-(a=b);
printf("after swap the value is:::");
printf("a=%d\tb=%d",a,b);
}
Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is a ternary operator in c?
write a programming in c to find the sum of all elements in an array through function.
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are the application of c?
What are conditional operators in C?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
Can you write the function prototype, definition and mention the other requirements.
Are bit fields portable?
Why is structure important for a child?
Tell us two differences between new () and malloc ()?
What is the difference between class and object in c?
How can I prevent another program from modifying part of a file that I am modifying?
How to delete a node from linked list w/o using collectons?
What are the differences between Structures and Arrays?