#include <stdio.h>
int main() {
int num,
decimal_num,
reminder,
base = 1,
binary = 0,
no_of_1s = 0;
printf("Enter a decimal Number: ");
scanf("%d", &num);
decimal_num = num;
while (num > 0) {
reminder = num % 2;
if (reminder == 1) {
no_of_1s++;
}
binary = binary + reminder * base;
num = num / 2;
base = base * 10;
}
printf("Input number is = %d\n", decimal_num);
printf("Ints binary number is %d\n", binary);
printf("No.of 1's in the binary is = %d\n", no_of_1s);
return 0;
}