write a program in C to swap two variables
Answer Posted / muzammil
#include <stdio.h>
#include <conio.h>
main()
{
int a,b;
printf("Enter the values: ");
scanf("%d%d",&a,&b);
printf("The values before swapping: %d %d",a,b);
a=a-(b=(-b+(a=a+b)));
printf("The values after swapping are: %d %d",a,b);
getch();
}
Is This Answer Correct ? | 14 Yes | 3 No |
Post New Answer View All Answers
When should the register modifier be used? Does it really help?
Why do we use static in c?
What is structure in c definition?
what is a constant pointer in C
What are type modifiers in c?
What is spark map function?
What is pointers in c?
What are the standard predefined macros?
Explain how can you restore a redirected standard stream?
develop algorithms to add polynomials (i) in one variable
What is null character in c?
What is the basic structure of c?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
Is it possible to pass an entire structure to functions?