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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Who developed c language?

646


can we implement multi-threads in c.

679


What is volatile variable how do you declare it?

576


Explain what are compound statements?

614


Explain how can I remove the trailing spaces from a string?

635






Can you please explain the difference between syntax vs logical error?

705


Describe explain how arrays can be passed to a user defined function

613


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1269


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

626


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

602


What is masking?

646


Can we use visual studio for c?

560


What are control structures? What are the different types?

610


What do header files do?

614


What are different types of variables in c?

579