Main Menu

Deitel Exersices
Downloads
Contact ME


 


Back


Links
CE Main Site
Sharif University
Wikipedia
2Del
PHP
Javascript





    

In the name of GOD


Deitel Exercise : 2.37

A company wants to trasmit data over the telephone, but is concerned that its phone could be trapped. All of the data are transmited as four-digit integers. The company has asked to write a progra mthat encryots 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 forth and print the encrypted integer.
Write a seperate program that inputs an encrypted four-digit integer and decrypts it form the original number.