cryptography (simple)

cpp.net United States
  • 15 years ago

    Hi!


    I hope someone can help me.  I am a newbie to C++ and have been given an assignment to write a program that reads in a four-digit integer and then replaces each digit by the (sum of that digit plus 7) % 10.  There are no instructions that state this four digit integer is an array.  How do I even begin to tell the program to take the first digit of a four digit integer when it is not an array?


    Any help would be appreciated!

  • 15 years ago

    Just a hint you can use union or structure for storage and perform this task.


    Regards,
    Rahul Gade

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perl - The only language that looks the same before and after RSA encryption.” - Keith Bostic