CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • silverscorpion

    MemberDec 14, 2011

    Iterate over each character in the string.
    If the character is an alphabet, add or subtract 13 from its ascii value, depending on the alphabet.
    If it's a non-alphabet, keep it as it is.
    Are you sure? This action cannot be undone.
    Cancel
  • silverscorpion

    MemberDec 14, 2011

    And "Cebtenzzvat Cenkvf vf sha" translates to "programming in praxis is fun"

    P.S I can't seem to be able to post python code. When I add the code in the reply and try to post, an error message saying "Internal server error" appears.
    Without the code, it seems to be ok.
    Are you sure? This action cannot be undone.
    Cancel
  • silverscorpion

    MemberDec 14, 2011

    The code could be,

    #include<stdio.h>
    #include<string.h>
    int main()
    {
        char s[50],new[50];int len,i,temp;
        printf("Enter The String To Be Encrypted");
        gets(s);
        len=strlen(s);
        for(i=0;i<len;i++) {
            if(s[i]>64&&s[i]<91) {
                if(s[i]>77)
                    s[i]=s[i]-13
                else
                    s[i]=s[i]+13
            }
            else if(s>96&&s<123) {
                if(s>109)
                    s[i]=s[i]-13
                else
                    s[i]=s[i]+13
            }
        }
     
        printf("The ROT13 Version Of The String Is\n\n");
        printf("%s",s);
    }
    Are you sure? This action cannot be undone.
    Cancel
  • Mystique_Myth

    MemberDec 14, 2011

    sorry dude.. actually i was unable to post that code.. can't get that "[]" in the code.. datz y i deleted it
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorDec 14, 2011

    Mystique_Myth
    sorry dude.. actually i was unable to post that code.. can't get that "[]" in the code.. datz y i deleted it
    Wrap it in the 'code' tags.
    Are you sure? This action cannot be undone.
    Cancel
  • silverscorpion

    MemberDec 14, 2011

    Hmm.. I can post C code, but not Python code?? :O
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register