include stdio include stdlib void nulling int char str 20 str2 20 itoa

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <stdlib.h>
void nulling(int x)
{
char str[20], str2[20];
itoa(x, str, 2);
printf("Number: %d\nBinary number : %s\n", x, str);
int length = 0;
while(str[length++]);
printf("Modified binary number: %s\nModified number: %d\n", str, x);
}
int main()
{
int x=12345;
nulling(x);
return 0;
}