SubhanUllah Posted October 12, 2022 Report Posted October 12, 2022 #include <stdio.h> int nodiai(int n){ int x = 0; while(n){ x++; n /= 10; } return x; } int main(){ printf("%d, %d\n", 1234, nodiai(1234)); printf("%d, %d\n", 1234567, nodiai(1234567)); } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.