write a program to swap two variables a=5 , b= 10 without
using third variable
Answer Posted / shafi.shaik
main()
{
int a,b;
clrscr();
printf("enter a, b Value");
scanf("%d%d",&a,&b);
printf("\n%d",a);
printf("\n%d",b);
b=b-a;
a=a+b;
b=a-b;
printf("\n%d",a);
printf("\n%d",b);
getch();
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What is extern variable in c with example?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
What does %c do in c?
provide an example of the Group by clause, when would you use this clause
In C language, a variable name cannot contain?
What are run-time errors?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
How do I get an accurate error status return from system on ms-dos?
Why c is called a mid level programming language?
How many types of functions are there in c?
Define circular linked list.
What does printf does?
Explain how to reverse singly link list.