write a program to swap Two numbers without using temp variable.
Answer Posted / manas ranjan(gift)
#include<stdio.h>
void main()
{
int a,b;
printf("enter the numbers");
scanf("%d%d",&a,&b);
printf("before swaping the values are");
printf("a=%d,b=%d",a,b);
void swap(int,int);
swap(a,b);
}
void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
printf("a=%d,b=%d",a,b);
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Why do we need functions in c?
Write a progarm to find the length of string using switch case?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
How can this be legal c?
What is the explanation for modular programming?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is the heap?
How can I remove the leading spaces from a string?
Hai what is the different types of versions and their differences
Why cant I open a file by its explicit path?
Explain how can I convert a number to a string?
What language is lisp written in?
Can you assign a different address to an array tag?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?