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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of comments are there in c++?

937


How do pointers work?

1127


What is an iterator class in c++?

1088


Write a program which uses Command Line Arguments

1109


Why is c++ a mid-level programming language?

962


What are multiple inheritances (virtual inheritance)?

1020


Define basic type of variable used for a different condition in C++?

1046


Why c++ is the best language?

1005


What is encapsulation in C++? Give an example.

1023


What is the use of typedef?

1033


Which compiler does turbo c++ use?

1020


What are the benefits of pointers?

982


What new()is different from malloc()?

1042


How do you establish a has-a relationship?

1035


What is lazy initialization in c++?

1048