wtd wrote:
The thing is, people here are reluctant to just give away complete source code. It's just asking for plagiarism, and we don't want to alienate teachers because we believe that compsci.ca can be a great learning tool.
If we help with plagiarism, teachers will tell students not to frequent this site and we'll lose an opportunity to help.
My teacher told me that I may use someone elses code, although I might lose some marks because the code is not completely mine, but I have to give them credit for it. So if you do decide to help me, I will guarantee you that I will place comment lines stating that I received this portion of code from you.
Andy wrote:
sry the code i posted last time was slitely buggy.. sory for the inconvenience
| code: |
int num=1111;
char hexletter[17]="0123456789ABCDEF";
char hex;
hex=hexletter[(num/125)+((num%1000)-(num%100))/25+((num%100)-(num%10))/5+(num%10)];
|
this only works for four digit binary numbers
When I use this code I get a Syntax Error:
Unexpected Symbol Ignored on this part char hexletter
[17]="0123456789ABCDEF";