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
Write a program to reverse a given number in c language?
What is f'n in math?
What does %p mean c?
What is the purpose of main() function?
List out few of the applications that make use of Multilinked Structures?
what do you mean by inline function in C?
How was c created?
What is main () in c language?
What is #line?
What are the c keywords?
Explain modulus operator. What are the restrictions of a modulus operator?
What are data structures in c and how to use them?
What is a program flowchart and how does it help in writing a program?
What is line in c preprocessor?
What are the different types of constants?