Can someone please help me where to begin on this problem... I don't want answers, just some guidance:
I have to make a program that reads a 4 digit integer: and encrypt it with a calculation: then swap 1st digit with 3rd, swap 2nd digit with 4th and print the integer; then write another program that inputs the encrypted 4 digit int and decrypt from the original number.
I want to use rand() and srand() to generate the numbers. But, I am also considering an array and create constant numbers to input: I thought that by scrammbling the numbers on input that this would automatically encrypt the numbers... (?): I am confused on where to begin to solve this problem (I do understand the calculation but am stuck on the encryption and decryption issue). Also, I think this problem needs to use a nested approach.... please tell me if I am on the right track: or can you please give me some direction or tell me if I am thinking correctly! I just need some clarity... thank you.
8 Years Ago
Related Article:Armstrong numbers
is a C discussion thread by smithag261 that has 7 replies and was last updated 7 years ago.
So wats problem in it just swap the digits....that the encrypted one.....and then again swap it back to decrypt
just convert the integer to strint using itoa() function, and then you can easly swape the digit-character. and then conver the this encrypted string back to integer using atoi() function. Visa-versa with decryption.