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
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
When should I declare a function?
Why c is procedure oriented?
What is pointer in c?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What's a good way to check for "close enough" floating-point equality?
What is data structure in c and its types?
Differentiate between null and void pointers.
What is maximum size of array in c?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
Differentiate between static and dynamic modeling.
What are qualifiers?
What are the advantages of using linked list for tree construction?
How can I trap or ignore keyboard interrupts like control-c?
Does c have circular shift operators?