write a program to swap Two numbers without using temp variable.
Answer Posted / sams
Two numbers are input through the keyboard into two
locations C and D. Write a program to interchange the
contents of C and D.
#include<stdio.h>
#include<conio.h>
void main( )
{
int a,b,c;
clrscr( );
printf("Enter A: ");
scanf("%d",&a);
printf("Enter B: ");
scanf("%d",&b);
c=a;
a=b;
b=c;
printf("\n The New Value Of A is : %d",a);
printf("\n The New Value Of B is : %d",b);
getch();
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
Is javascript based on c?
using only #include
Describe newline escape sequence with a sample program?
what is the different bitween abap and abap-hr?
What is meant by int main ()?
What is boolean in c?
What is the difference between arrays and pointers?
Explain why c is faster than c++?
In c programming language, how many parameters can be passed to a function ?
What is wild pointer in c with example?
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Why is main function so important?
Explain what happens if you free a pointer twice?
How can I recover the file name given an open stream?