C programming | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C programming

Guys how can i write a program in c that i get a number and then delete its zeros and again print it. For example if it gets 10034 print 134

26th Oct 2019, 9:31 AM
Bahar Khdz
Bahar Khdz - avatar
1 Answer
+ 1
- input a number from stdin and let it as a char array. - create a buffer of size = to the input - copy all char from input to that buffer if char != '0' - don't forget to add a null char at the end of the buffer - print the buffer.
26th Oct 2019, 9:46 AM
Théophile
Théophile - avatar