Write a program to interchange two variables without using
the third variable?
Answer Posted / mahendra giri
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
c=a+b;
b=a-b;
a=a-b;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 23 Yes | 44 No |
Post New Answer View All Answers
Describe newline escape sequence with a sample program?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
How to declare pointer variables?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
In which layer of the network datastructure format change is done
What do the functions atoi(), itoa() and gcvt() do?
What is the 'named constructor idiom'?
What are the advantages of using macro in c language?
Explain what is a stream?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Write a program to identify if a given binary tree is balanced or not.
How can I delete a file?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
Why doesnt long int work?