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 do you mean by dynamic memory allocation in c? What functions are used?
What are header files and what are its uses in C programming?
What are the features of c language?
What is the difference between malloc() and calloc()?
What is difference between structure and union in c programming?
How can I prevent another program from modifying part of a file that I am modifying?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
How can you determine the size of an allocated portion of memory?
What is string constants?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What are the different types of endless loops?
What is a string?
what are the different storage classes in c?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
Can static variables be declared in a header file?