write a program to swap Two numbers without using temp variable.

Answer Posted / bhokal

#include <stdio.h>
#include <stdlib.h>

void main()
{
int p,r;
printf("enter no to b swaped:\n");
scanf("%d%d",&p,&r);
printf("swapped no . are\n%d\n%d\n",r,p);
getch();
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a list in c?

784


Multiply an Integer Number by 2 Without Using Multiplication Operator

532


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1741


What language is windows 1.0 written?

774


What's the right way to use errno?

841


Explain a file operation in C with an example.

875


Explain the use of keyword 'register' with respect to variables.

796


How do you determine the length of a string value that was stored in a variable?

852


What is static and auto variables in c?

780


What is the difference between ‘g’ and “g” in C?

3400


Are c and c++ the same?

792


Can we change the value of static variable in c?

744


Explain what is a static function?

833


Explain what is a program flowchart and explain how does it help in writing a program?

851


What is the difference between if else and switchstatement

1557