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
What is the use of #define preprocessor in c?
What are the advantages of union?
What is clrscr in c?
What are the disadvantages of c language?
What is the difference between the = symbol and == symbol?
find the sum of two matrices and WAP for it.
what will be maximum number of comparisons when number of elements are given?
How can I dynamically allocate arrays?
Can we declare a function inside a function in c?
What are the types of data structures in c?
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
Explain what is gets() function?
What is a method in c?
What is the hardest programming language?
Explain the difference between call by value and call by reference in c language?