Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions C/program-55/program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Program that prints a number in binary*/

// start writng code from here
#include <stdio.h>

int main (void)
{
int b;
unsigned int mask = 1<<31;

printf("Input a 32bits integer number: ");
scanf("%d", &b);

while (mask != 0){
printf("%d", b&mask?1:0);
mask >>= 1;
}

printf("\n");

return 0;
}
4 changes: 4 additions & 0 deletions C/program-55/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# program-55
## Program that prints a number in binary

This program uses bitwise operators to print a 32bits integer in binary representation