write a program to swap Two numbers without using temp variable.
Answer Posted / kabita shah
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int x,y;
printf("enter two value");
scanf("%d%d",&x,&y);
x=x+y;
y=x-y;
x=x-y;
printf("value of x=%d",x);
printf("value of y=%d",y);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is it possible to pass an entire structure to functions?
What is the difference between far and near in c?
Write a program to swap two numbers without using third variable?
Is c call by value?
When should the const modifier be used?
What is a nested loop?
Why is python slower than c?
What does the format %10.2 mean when included in a printf statement?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Are negative numbers true in c?
Are comments included during the compilation stage and placed in the EXE file as well?
What is substring in c?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is structure in c language?
Write a program for Overriding.