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

Do class declarations end with a semicolon?

1088


What is the use of class in c++?

1086


What is switch case in c++ syntax?

1116


an operation between an integer and real always yeilds a) integer result b) real result c) float result

1160


What is ofstream c++?

1088


Difference between overloading vs. Overriding

1094


What is c++ and its features?

1018


What are the important differences between c++ and java?

1157


Is c or c++ more useful?

1055


How to demonstrate the use of a variable?

1124


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

2316


Do you need a main function in c++?

1126


What do you mean by storage classes?

1606


What is buffering in c++?

1063


What are shallow and deep copy?

1121