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 |
Which is the best c++ compiler for beginners?
Explain the volatile and mutable keywords.
What is the output of printf("%d")?
58 Answers CTS, HCL, Infosys, TCS, Winit, Wipro,
What is a protocol class?
What is the difference between the indirection operator and the address of oper-ator?
What is a "Copy Constructor"?
Explain the auto storage classes in c++.
What is a virtual destructor?
Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).
How much is size of struct having 1 char & 1 integer?
what is data Abstraction
Implement strncpy