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.
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 |
What does int * mean in c++?
Is c++ proprietary?
What does scope resolution operator do?
Differentiate between a deep copy and a shallow copy?
Write about the use of the virtual destructor?
What is the most powerful coding language?
What do manipulators do?
What is the output of the following program? Why?
What is unary operator? List out the different operators involved in the unary operator.
How does class accomplish data hiding in c++?
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?
What are built-in functions? What is the syntax for the definition?