SHARE
TWEET

Untitled

a guest Feb 27th, 2020 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 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.*/
  2.                       printf("ERROR! The user entered another character,so enter another character again!\n");
  3.                       scanf("\n%c",&secretcode);}
  4.  
  5.                  while (secretcode>0){ /* I will use this algorithm to convert decimal numbers to binary form */
  6.  
  7.                   remainder= secretcode%2;
  8.                   power=pow(10,place);
  9.  
  10.                   binary=binary+(remainder*power);
  11.                   place++;
  12.                   secretcode=secretcode/2;}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top