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 can c++ be used for?
What are structures and unions?
Will c++ be replaced?
What is an associative container in c++?
structure contains int, char, float how it behaves for big endian and little endian?
What is meant by iomanip in c++?
How do we implement inheritance in c++?
What is DlgProc?
What is a smart pointer?
sizeof - is it a function or operator?
Why c++ is faster than java?
Explain how to initialize a const member data.