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 a reference variable in C++?
What is a built-in function?
What is the use of register keyword with the variables?
What are move semantics?
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 )?
How do you initialize a string in c++?
What are the different types of polymorphism?
Explain the term memory alignment?
Explain the difference between class and struct in c++?
plz send me National informatics center paper pattern
Tell me difference between constant pointer and pointer to a constant.
What does I ++ mean in c++?