let a,b,c be three integer numbers.write a c++ program
with a function void rotate 1()such that a->b->c and c->a.



let a,b,c be three integer numbers.write a c++ program with a function void rotate 1()such that a..

Answer / zain

#include <iostream>
using namespace std;
int swap(int,int,int);
int main()
{
int a,b,c;
cout<<" enter 3 number"<<endl;
cin>>a>>b>>c;
swap(a,b,c);
cout<<"in main"<<a<<""<<b<<""<<c<<endl;
return 0;
}

int swap(int i,int j,int w)
{
int t;
t=i;
i=j;
j=w;
w=t;
cout<<"in swap function"<<i<<""<<j<<""<<w<<endl;
return 0;
}

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C++ General Interview Questions

What does int * mean in c++?

0 Answers  


Is c++ proprietary?

0 Answers  


What does scope resolution operator do?

0 Answers  


Differentiate between a deep copy and a shallow copy?

1 Answers  


Write about the use of the virtual destructor?

0 Answers  






What is the most powerful coding language?

0 Answers  


What do manipulators do?

0 Answers  


What is the output of the following program? Why?

0 Answers  


What is unary operator? List out the different operators involved in the unary operator.

0 Answers  


How does class accomplish data hiding in c++?

0 Answers  


what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?

0 Answers  


What are built-in functions? What is the syntax for the definition?

0 Answers  


Categories