write a program to swap Two numbers without using temp variable.
Answer Posted / ankit tiwari
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter the two number");
scanf("%d%d",&a,&b);
a=b-a;
b=b-a;
a=b+a;
printf("ais=%d",a);
printf("b is=%d",b);
getch();
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Can you please explain the difference between strcpy() and memcpy() function?
What is unsigned int in c?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Explain how can you check to see whether a symbol is defined?
What is the difference between new and malloc functions?
What is wrong in this statement? scanf(“%d”,whatnumber);
Is main an identifier in c?
What is the difference between declaring a variable and defining a variable?
What does *p++ do?
Explain how can I prevent another program from modifying part of a file that I am modifying?
How to explain the final year project as a fresher please answer with sample project
What's the total generic pointer type?
Write a program to swap two numbers without using third variable in c?
What is data structure in c programming?
What are the scope of static variables?