HOW TO SWAP TWO NOS IN ONE STEP?

Answer Posted / venkatesh sabinkar

#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=2,t;
clrscr();
printf("a=%d,b=%d",a,b,b=t,a=b,t=a);
getch();
}

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pass by value in c?

591


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

2715


Explain the difference between call by value and call by reference in c language?

637


What are register variables? What are the advantage of using register variables?

671


what are the different storage classes in c?

656






How to implement a packet in C

2386


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

1895


How is pointer initialized in c?

577


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?

1563


What is meant by keywords in c?

610


Why is it important to memset a variable, immediately after allocating memory to it ?

1546


Is c++ based on c?

642


What is the difference between a free-standing and a hosted environment?

634


What is a ternary operator in c?

646


Explain about the functions strcat() and strcmp()?

595