Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Calculate the number of digits in an integer 12345.

Medium

Problem Statement

Calculate the number of digits in an integer 12345.

Sample Input

12345

Sample Output

Number of digits: 5

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int countDigits(int num) { // Your code here } int main() { int num = 12345; printf("Number of digits: %d\n", countDigits(num)); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
12345
Expected Output
Number of digits: 5