write a prgram of swapping with 2 valiables

Answer Posted / kumar

#include<stdio.h>
#include<conio.h>
void main()
{
int x,y ;
int z = 0;
clrscr();

printf("Enter 'x' value :");
scanf("%d",&x);

printf("\nEnter 'y' value :");
scanf("%d",&y);

z=x;
x=y;
y=z;
printf("\nAfter swaping x= %d,y= %d ",x,y);

getch();
}

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is use of null pointer in c?

563


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

643


In C programming, how do you insert quote characters (‘ and “) into the output screen?

888


Explain what is the difference between a free-standing and a hosted environment?

630


How to declare a variable?

564






What is the description for syntax errors?

609


State two uses of pointers in C?

636


Tell us the use of fflush() function in c language?

631


What is the use of getchar functions?

672


What is masking?

633


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

654


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

5790


Was 2000 a leap year?

623


What is 02d in c?

632


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3049