Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Describe the syntax of single inheritance in C++?

0 Answers   Fidelity,


What is c++ best used for?

0 Answers  


What is difference between c++ 11 and c++ 14?

0 Answers  


Why is it difficult to store linked list in an array?

6 Answers   Infosys, Lucent,


Does defining a function inline mean that it wont push and pop things on/off the stack ...like parameters and the return the address??

2 Answers  


Is c++ a pure oop language?

0 Answers  


What is the use of map in c++?

0 Answers  


What is ofstream c++?

0 Answers  


Specify some guidelines that should be followed while overloading operators?

0 Answers  


What is difference between array and vector in c++?

0 Answers  


What are the operators in c++?

0 Answers  


What is istream c++?

0 Answers  


Categories