swap two integer variables without using a third temporary
variable?
Answer Posted / sidhartha
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("\n ENTER 2 VALUES : ");
scanf("%d%d",&a,&b);
printf("\n THE VALUES BEFORE SORTING : %d,%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\n THE VALUES AFTER SORTING : %d,%d",a,b);
getch();
}
| Is This Answer Correct ? | 40 Yes | 1 No |
Post New Answer View All Answers
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
Explain built-in function?
What does main () mean in c?
Explain how do you determine a file’s attributes?
What is difference between scanf and gets?
how to find anagram without using string functions using only loops in c programming
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
What functions are used for dynamic memory allocation in c language?
I came across some code that puts a (void) cast before each call to printf. Why?
What is the data segment that is followed by c?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What are the main characteristics of c language describe the structure of ac program?
What is meant by high-order and low-order bytes?
Why do we use header files in c?