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

What is ifstream c++?

1017


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

1199


describe private access specifiers?

1208


What do you mean by ‘void’ return type?

1046


What is java and c++?

1158


Explain how overloading takes place in c++?

1029


Explain the pure virtual functions?

1101


What is iterator c++?

968


Can recursive program be written in C++?

1220


What is the use of typedef?

1081


List the advantages of inheritance.

1115


What is the difference between struct and class?

1527


Can we use this pointer inside static member function?

1058


What happens if a pointer is deleted twice?

1263


What is new in c++?

1088