An Interest In:
Web News this Week
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
- March 14, 2024
November 24, 2022 02:37 pm GMT
Original Link: https://dev.to/valery_drantyev_a87761b31/encrypt-a-number-a48
Encrypt a number
Hello everyone. I am self learning C from the Dietel and Dietel book C How to program. I am doing an assignment at the end of the chapter that requires a user to enter a four digit integer that will be encrypted as follows. Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap first digit with third, and second with fourth. Then display the digit. I think I can solve the first part of the problem. I am not sure how I will switch the digits places. Any suggestions is appreciated. So far the material have only covered while loop, if, else if, and I can only use what's available to me up to this point. I look forward to your suggestions. Thank you.
Original Link: https://dev.to/valery_drantyev_a87761b31/encrypt-a-number-a48
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To