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 is an inclusion guard?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
Write a program which employs Recursion
What is &x in c++?
What are inline functions?
What are the effects after calling the delete this operator ?
What is using namespace std in c++?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
What is difference between array and vector in c++?
Will the following program execute?
Is there something that we can do in C and not in C++?
Which of the following is evaluated first: a) && b) || c) !