write a program in C to swap two variables

Answer Posted / anju

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,temp;
scanf("%d%d",&a,&b);
printf("before swapping value of a=%d and b=%d",a,b);
temp=x;
x=y;
y=temp;
printf("after swapping value of a=%d and b=%d",a,b);
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is extern c used for?

571


#include { printf("Hello"); } how compile time affects when we add additional header file .

1425


ATM machine and railway reservation class/object diagram

4806


Write a program to implement queue.

667


What are the two types of functions in c?

567






How can you determine the maximum value that a numeric variable can hold?

642


What is a program?

668


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

653


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

1602


Explain how do you sort filenames in a directory?

609


differentiate built-in functions and user – defined functions.

629


What does main () mean in c?

616


Explain 'bit masking'?

656


What is an auto keyword in c?

644


What is the best way of making my program efficient?

572