Write a program to interchange two variables without using
the third variable?
Answer Posted / neelam
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no.s 4 swap");
scanf("%d%d",&a,&b);
a=a+b;;
b=a-b;
a=a-b;
printf("After swapping no.s are =\n");
printf("a=%d b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
What are void pointers in c?
what is stack , heap ,code segment,and data segment
Write the control statements in C language
What is the stack in c?
What is the difference between if else and switchstatement
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Does c have enums?
what is the different bitween abap and abap-hr?
What is the use of structure padding in c?
What is s in c?
where are auto variables stored? What are the characteristics of an auto variable?
What is a static function in c?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
what is recursion in C
write a program to print data of 5 five students with structures?