0

Can anyone tell me about this code is right for binary equalant

#include <stdio.h> int main() { unsigned int num; int i; scanf("%u",&num); for(i=0;i<16;i++) printf("%d", (num<<i&1<<15)? 1:0); return 0; } Why the code is not printing correct value for the value 50 or more can anyone explain me what this code is doing

28th Sep 2019, 1:43 PM
Preity
Preity - avatar
7 Antworten
0
~ swim ~ can you explain me the working of code I want to make something else but ended to making this
28th Sep 2019, 1:57 PM
Preity
Preity - avatar
0
Martin Taylor so basically what my code is doing its printing all even bits of number or printing all odd bits of number
28th Sep 2019, 2:14 PM
Preity
Preity - avatar
28th Sep 2019, 2:28 PM
Kuri
Kuri - avatar