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


Please Help Members By Posting Answers For Below Questions

What are references in c++?

868


What is the difference between a pointer and a link in c ++?

768


What is the basic structure of a c++ program?

804


What is the difference between prefix and postfix versions of operator++()?

802


Can a list of string be stored within a two dimensional array?

760


Should I learn c or c++ first?

825


Specify some guidelines that should be followed while overloading operators?

845


Write syntax to define friend functions in C++.

808


List the features of oops in c++?

757


What is the role of C++ shorthand's?

965


explain the reference variable in c++?

785


What is endl?

869


What is the function of I/O library in C++ ?

866


What is c++ w3school?

843


Explain the difference between c++ and java.

850