write a program to swap two variables a=5 , b= 10 without
using third variable
Answer Posted / dhanalakshmi
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter the a value"));
scanf("%d",&a);//a=10
printf("enter the b value");
scanf("%d",&b);//b=5
b=b+a;
a=b-a;
b=b-a;
printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
}
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Should a function contain a return statement if it does not return a value?
Why is extern used in c?
Do pointers store the address of value or the actual value of a variable?
What is void pointers in c?
What are the modifiers available in c programming language?
What is typedef?
What is the meaning of typedef struct in c?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
How can I access an I o board directly?
What is the difference between text and binary modes?
Explain what are multibyte characters?
What is the use of bit field?
Write a program to reverse a linked list in c.
i want to know the procedure of qualcomm for getting a job through offcampus
How does struct work in c?