10. Write a C program to convert decimal number to binary using functions.
Answers
Answered by
1
Answer:
#include <stdio.h>
int main()
{
int n, c, k;
printf("Enter an integer in decimal number system\n");
scanf("%d", &n);
printf("%d in binary number system is:\n", n);
for (c = 31; c >= 0; c--)
{
k = n >> c;
if (k & 1)
printf("1");
else
printf("0");
}
printf("\n");
return 0;
}
Hope you found it helpful
Answered by
0
Explanation:
kdodsmsbbsnsls
'sldmdls
sllzkpdls
Similar questions
Computer Science,
1 month ago
Hindi,
1 month ago
Computer Science,
1 month ago
Math,
2 months ago
Math,
2 months ago
Computer Science,
9 months ago
History,
9 months ago