write a program to interchange the value between two variable
without using loop



write a program to interchange the value between two variable without using loop..

Answer / mudita rathore

#include<stdio.h>
void main()
{
int a,b,temp;
printf("enter value of a=");
scanf("%d",&a);
printf("enter the value of b=");
scanf("%d",&b);
temp=a;
a=b;
b=temp;
printf("a=%d b=%d",a,b);
}

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More C Interview Questions

what is the difference between exit() and _exit() functions?

2 Answers  


What do you mean by command line argument?

0 Answers   TCS,


What is the equivalent code of the following statement in WHILE LOOP format?

0 Answers  


1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?

3 Answers   Qualcomm,


Difference between pass by reference and pass by value?

0 Answers   TCS, TISL,


#include<stdio.h> int main() { int i=2; int j=++i + ++i + i++; printf("%d\n",i); printf("%d\n",j); }

15 Answers   Infosys,


How many bytes is a struct in c?

0 Answers  


How to write a program for swapping two strings without using 3rd variable and without using string functions.

7 Answers   iGate, Infotech,


how to find a 5th bit is set in c program

4 Answers   IBM,


What does %d do in c?

0 Answers  


What is putchar() function?

0 Answers  


Why is it that not all header files are declared in every C program?

0 Answers  


Categories