It's pointless to do your work for you. You clearly don't want to even learn. You're not trying to understand what's going on in the code. You just want it done for you. This is just begging for a lock.
Quzah.
It's pointless to do your work for you. You clearly don't want to even learn. You're not trying to understand what's going on in the code. You just want it done for you. This is just begging for a lock.
Quzah.
Hope is the first step on the road to disappointment.
Fine lock it and make my evening! I don't see what the difference is, I'm tyring to ........ing learn here. Not sure what I'm doing wrong, all you guys are just saying bit this bit that and not actually posting anything useful...Originally Posted by quzah
To me bit this bit that is pointless, I already made an online school in perl and JS, not such basic trivial operations confuse me, i'm sorry! gah
12 & 0 is zero.Code:z = x & d;
So neither of these print, as you coded.Code:if ( z>0 ) { printf("1"); } if ( z<0 ) { printf("0"); }What is 0 left shifted 1?Code:z = z<<1;
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
0 <<1 ;
= 00?
:s
Code:#include <stdio.h> #include <conio.h> void bin_prnt_byte(int x); void main(void) { clrscr(); bin_prnt_byte(0xc); printf("\n"); } void bin_prnt_byte(int x) { int n; for(n=0; n<8; n++) { if((x & 0x80) !=0) { printf("1"); } else { printf("0"); } if (n==3) { printf(" "); /* insert a space between nybbles */ } x = x<<1; } }