write a program to swap two variables a=5 , b= 10 without
using third variable
Answer Posted / samruthi
#include<stdio.h>
void main()
{
int a=5,b=10;
printf("The value of A is:%d",a);
printf("\n The value of B is:%d",b);
b=a;
a=b;
a=b+a;
printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
getch();
}
| Is This Answer Correct ? | 10 Yes | 7 No |
Post New Answer View All Answers
How can I remove the leading spaces from a string?
what are the 10 different models of writing an addition program in C language?
What are all different types of pointers in c?
Explain the concept and use of type void.
Is c is a middle level language?
How can I get the current date or time of day in a c program?
Why use int main instead of void main?
What is string concatenation in c?
What does 2n 4c mean?
What is the size of a union variable?
How can I find out the size of a file, prior to reading it in?
how many errors in c explain deply
What are derived data types in c?
What are local static variables?
write a c program in such a way that if we enter the today date the output should be next day's date.