help i can not figure this out.
my home is to encryption a four digit number
I have to add 7 and use mod 10-- i think i have that part but now i need to swap the first number with the third and second with the fourth. i can not get it--here is my code
i know 41 is wrong but i am drawing a blank
//christine gershen
// Exercise 4.17: Encryption.cpp
// Encrypts data given by user.
#include <iostream> // required to perform C++ stream I/O
#include <iomanip> // required to perform setprecision stream manipulator
using namespace std; // for accessing C++ Standard Library members
int main() // function main begins program execution
{
int main=0;
int digit_one; //store digit one
int digit_two; //store digit two
int digit_three; //store digit three
int digit_four; //store digit four
int encryption; //store encryption
cout <<"Enter four-digit number:"; //asking the user to enter four-digit number
cin >> main; //four-digit number
digit_one=main/1000%10; // digit_one is first four-digit number
digit_two=main/100%10; // digit_two is second four-digit number
digit_three=main/10%10; //digit_three is third four-digit number
digit_four=main%10; //digit_four is fourth four-digit number
digit_one+=7%10; //add digit_two to 7 and mod 10
digit_two+=7%10; //add digit_two to 7 and mod 10
digit_three+=7%10; //add digit_three to 7 and mod 10
digit_four+=7%10); //add digit_four to 7 and mod 10
encryption=digit_three digit_four digit_one digit_two
cout <<"Encrypted digits:" << encryption <<endl; // display encrypted numbers
return 0; // indicate that program ended successfully
}// end function main
/**************************************************************************
* (C) Copyright 1992-2005 by Deitel & Associates, Inc. and *
* Pearson Education, Inc. All Rights Reserved. *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development, research, and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind, expressed or implied, with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with, or arising out of, the *
* furnishing, performance, or use of these programs. *
**************************************************************************/