write a program to swap Two numbers without using temp variable.
Answer Posted / sneha chorghade
#include<stdio.h>
void main()
{
int a=2,b=3;
printf("before swap the value is:::");
printf("a=%d\tb=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swap the value is:::");
printf("a=%d\tb=%d",a,b);
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
The file stdio.h, what does it contain?
What is sizeof c?
Explain what is the benefit of using #define to declare a constant?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Explain the process of converting a Tree into a Binary Tree.
What do you know about the use of bit field?
What is #line in c?
Explain what is the general form of a c program?
Is there any possibility to create customized header file with c programming language?
How can you tell whether a program was compiled using c versus c++?
What is sizeof in c?
Explain the difference between malloc() and calloc() function?
What is a dynamic array in c?
Explain why can’t constant values be used to define an array’s initial size?