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
List some applications of c programming language?
what is the role you expect in software industry?
Explain the array representation of a binary tree in C.
Differentiate abs() function from fabs() function.
What does %d do in c?
Explain is it valid to address one element beyond the end of an array?
How can you allocate arrays or structures bigger than 64K?
What is %lu in c?
How will you delete a node in DLL?
What is the best way to store flag values in a program?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
simple program of graphics and their output display
What are different types of pointers?
What is #pragma statements?
Can static variables be declared in a header file?