Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ( secretcode<48 || secretcode>122){ /*According to the ASCII TABLE;0-9 has ASCII code of 48-57 and uppercase letters (A-Z)have ASCII code of 65-90 and lowercase characters have ASCII code of 98-122.So that it is certain that secretcode should not be lower than 48 and upper than 122.*/
- printf("ERROR! The user entered another character,so enter another character again!\n");
- scanf("\n%c",&secretcode);}
- while (secretcode>0){ /* I will use this algorithm to convert decimal numbers to binary form */
- remainder= secretcode%2;
- power=pow(10,place);
- binary=binary+(remainder*power);
- place++;
- secretcode=secretcode/2;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement