write a program in C to swap two variables
Answer Posted / senthil mca sns
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the a value:");
scanf("%d",&a);
printf("Enter the b value:");
scanf("%d",&b);
b=a+b-(a=b);
printf("After Swapping a=%d,b=%d",a,b);
getch();
}
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is call by reference in functions?
What are header files and explain what are its uses in c programming?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
what are the 10 different models of writing an addition program in C language?
What does main () mean in c?
Why pointers are used?
how to execute a program using if else condition and the output should enter number and the number is odd only...
Where are the auto variables stored?
What is use of #include in c?
int far *near * p; means
What is dynamic memory allocation?
Why c language is called c?
How pointers are declared?
How would you obtain the current time and difference between two times?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.