This is the problem:

----------------------------------------------------------------------------------------------

(Cryptography) A company wants to transmit data over the telephone,

but is concerned that its phones could be tapped. All of the data are

transmitted as four-digit integers. The company has asked you to write

a program that encrypts the data so that it can be transmitted more

securely. Your program should read a four-digit integer and encrypt

it as follows: Replace each digit by (the sum of that digit plus 7)

modulus 10. Then, swap the first digit with the third, swap the second

digit with the fourth and print the encrypted integer. Write a separate

program that inputs an encrypted four digit integer and decrypts it to

form the original number.

--------------------------------------------------

Sample Run of the encrypting program

--------------------------------------------------

Enter numbers to encrypt (0000 to end):

1234 1111 3290 1800 0000

The encrypted numbers are:

0189 8888 6709 7785

--------------------------------------------------

Sample Run of the decrypting program

--------------------------------------------------

Enter numbers to decrypt (0000 to end):

0189 8888 6709 7785 0000

The decrypted numbers are:

1234 1111 3290 1800

------------------------------------------------------------------------

All I have is this:

I have no idea how to output the encrypted numbers all at the same time.Code:#include <iostream> using namespace std; int main() { int digit1, digit2, digit3, digit4, encrypt1, encrypt2, encrypt3, encrypt4,number; cin>>number; digit4 = number % 10; digit3 = ((number % 100) - digit4)/10; digit2 = ((number % 1000) - digit3)/100; digit1 = ((number - number % 1000))/1000; encrypt1 = (digit3 + 7)%10; encrypt2 = (digit4 + 7)%10; encrypt3 = (digit1 + 7)%10; encrypt4 = (digit2 + 7)%10; if (number == 0) { cout<<endl; } else { while (number != 0) { cout<<encrypt1<<encrypt2<<encrypt3<<encrypt4<<"\n"; cin>>number; digit4 = number % 10; digit3 = ((number % 100) - digit4)/10; digit2 = ((number % 1000) - digit3)/100; digit1 = ((number - number % 1000))/1000; encrypt1 = (digit3 + 7)%10; encrypt2 = (digit4 + 7)%10; encrypt3 = (digit1 + 7)%10; encrypt4 = (digit2 + 7)%10; } } }