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 |
Describe the syntax of single inheritance in C++?
What is c++ best used for?
What is difference between c++ 11 and c++ 14?
Why is it difficult to store linked list in an array?
Does defining a function inline mean that it wont push and pop things on/off the stack ...like parameters and the return the address??
Is c++ a pure oop language?
What is the use of map in c++?
What is ofstream c++?
Specify some guidelines that should be followed while overloading operators?
What is difference between array and vector in c++?
What are the operators in c++?
What is istream c++?