Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 24, 2022 02:37 pm GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To