Write a program to interchange two variables without using
the third variable?
Answer Posted / genius
#include <stdio.h>
#include <conio.h>
main()
{
int a,b,temp;
clrscr();
printf("enter two numbers:");
scanf("%d,%d",&a,&b);
printf("values of a and b are %d,%d \n",a,b);
temp=a;
a=b;
b=temp;
printf("swapped values of a and b are %d,%d", a,b);
getch();
}
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
What is the function of volatile in c language?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is the purpose of scanf() and printf() functions?
What are the advantages of the functions?
How do I get an accurate error status return from system on ms-dos?
How can I get random integers in a certain range?
What is c system32 taskhostw exe?
What are the disadvantages of c language?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Write a program to swap two numbers without using the third variable?
hi send me sample aptitude papers of cts?
Define and explain about ! Operator?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above