write a program to swap Two numbers without using temp variable.
Answer Posted / sree
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}
Is This Answer Correct ? | 73 Yes | 24 No |
Post New Answer View All Answers
Is javascript based on c?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
Why does everyone say not to use scanf? What should I use instead?
What is the maximum no. of arguments that can be given in a command line in C.?
What are the advantages of using Unions?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What are the types of macro formats?
What is a lvalue
What is union in c?
What is the use of function in c?
Which programming language is best for getting job 2020?
What is sizeof int in c?
how logic is used
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
Explain what standard functions are available to manipulate strings?