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.



let a,b,c be three integer numbers.write a c++ program with a function void rotate 1()such that 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

Post New Answer

More C++ General Interview Questions

Why #include is used?

1 Answers  


What is binary search in c++?

1 Answers  


What are the differences between java and c++?

1 Answers  


Explain the difference between realloc() and free() in c++?

1 Answers  


What do you mean by early binding?

1 Answers  


How do you test your code?

4 Answers   Microsoft,


What and all can a compiler provides by default?

3 Answers   Accenture, HP,


What is meant by const_cast?

1 Answers  


Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);

2 Answers  


What is the difference between reference type and pointers.

4 Answers   HCL,


List out some of the object-oriented methodologies?

1 Answers  


Why c++ is faster than java?

1 Answers  


Categories