How to swap two values using a single variable ?
condition: Not to use Array and Pointer ?
Answer Posted / ankit anupam
well i think this was wht u were lookin for
#include<stdio.h>
int main()
{
int a, b;
printf("Enter two no");
scanf("%d%d",&a,&b);
printf("a=%d nd b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("a=%d nd b=%d",a,b);
return 0;
}
Is This Answer Correct ? | 16 Yes | 3 No |
Post New Answer View All Answers
How can my program discover the complete pathname to the executable from which it was invoked?
What is string function in c?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
What are enums in c?
What are the types of type qualifiers in c?
What does s c mean in text?
What is void main () in c?
What is the difference between #include and #include 'file' ?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What are pragmas and what are they good for?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
Is that possible to store 32768 in an int data type variable?
Explain a file operation in C with an example.
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions