+ 1
Does this program efficient enough?
In this code i use 2 additional header other than <stdio.h>. My question is does the additional header is needed in the code or this code could be made with fewer header? https://sololearn.com/compiler-playground/cfWArdOmniFD/?ref=app Btw the code is running and i just want to know other alternative to solve this.
2 Answers
+ 5
Yes. Additional headers are needed as
-> string.h for strlen() function to work well..
-> ctype.h for isdigit() function to work well..
Yes. You can write code without using those headers..
Use just for(int i=0; a[i] ; i++) as loop header..
Also if( a[i] >= '0' && a[i]<= '9' ) as if condition..
There may be other ways..
+ 2
Jayakrishna đźđł 's suggestions are great.
you can implement your own strlen and isdigit functions
https://sololearn.com/compiler-playground/cPC7ouCp2lvK/?ref=app