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 Posted / 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 View All Answers
What is ifstream c++?
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
describe private access specifiers?
What do you mean by ‘void’ return type?
What is java and c++?
Explain how overloading takes place in c++?
Explain the pure virtual functions?
What is iterator c++?
Can recursive program be written in C++?
What is the use of typedef?
List the advantages of inheritance.
What is the difference between struct and class?
Can we use this pointer inside static member function?
What happens if a pointer is deleted twice?
What is new in c++?