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

How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include<stdio.h>...

0 Answers  


What is c programing language?

0 Answers  


What is scope and lifetime of a variable in c?

0 Answers  


How do we select the big element or any other operation from array which is read dynamically. user need to give the elements only no need to mention the size.

0 Answers  


What is an object?

5 Answers  






#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?

1 Answers  


Write a program to swap two numbers without using a temporary variable?

0 Answers   Infosys,


Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors

3 Answers  


What is c language used for?

0 Answers  


Convert the following expression to postfix and prefix (A+B) * (D-C)

3 Answers   Satyam,


Why doesn't the code "a[i] = i++;" work?

4 Answers  


What are type modifiers in c?

0 Answers  


Categories