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

what is a reference variable in C++?

0 Answers  


What is a built-in function?

1 Answers  


What is the use of register keyword with the variables?

0 Answers  


What are move semantics?

0 Answers  


Write a c++ code that will calculate the roots of a quadratic equation a2+ bx+c=0 Hint: d = sqrt (b2-4ac), and the roots are: x1 = (€“b + d)/2a and x2 = (€“b €“ d)/2a (use sqrt function from cmath.h )?

0 Answers   Maxobiz,






How do you initialize a string in c++?

0 Answers  


What are the different types of polymorphism?

3 Answers  


Explain the term memory alignment?

0 Answers  


Explain the difference between class and struct in c++?

0 Answers  


plz send me National informatics center paper pattern

1 Answers  


Tell me difference between constant pointer and pointer to a constant.

0 Answers   Honeywell, Zomato,


What does I ++ mean in c++?

0 Answers  


Categories