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
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
Explain method of creating object in C++ ?
Is c++ double?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
Incase of a function declaration, what is extern means?
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
How would you differentiate between a pre and post increment operators while overloading?
How would you use the functions randomize() and random()?
What are c++ manipulators?
Which programming language should I learn first?
What is the full form of india?
Can you declare an array without a size in c++?
What is the first name of c++?
Should I learn c or c++ or c#?
What is the use of namespace std in C++?