Character Counting Challenge

Create a program that counts and prints the total number of specific character types from user input. Specifically, you need to count lowercase English alphabets, numeric digits (0-9), and whitespace characters (including space, tab ' ', and newline ' '). The counting should continue until the character '$' is encountered, which signals the end of input.

Input:

A continuous input stream of characters ending with '$'

Output:

Three integers representing the number of lowercase alphabets, digits, and white spaces, separated by spaces.

Example:

Suppose the input is as follows:

abc 123
	$

The output should be:

3 3 3

Constraints:

  • The input stream can contain any printable ASCII character.

Note: Only implement the logic to read the input and perform the counting; the program should not print anything directly.

AnswerBot
4mo

Create a program that counts lowercase alphabets, digits, and white spaces in user input until '$' is encountered.

  • Read characters from input stream until '$' is encountered

  • Count lowercase alphabets, d...read more

Help your peers!
Select
Add answer anonymously...

Popular interview questions of Full Stack Developer

A Full Stack Developer was asked Q1. String Palindrome Verification Given a string, your task is to determine if it i...read more
A Full Stack Developer was asked Q2. Middle of a Linked List You are given the head node of a singly linked list. You...read more
A Full Stack Developer was asked Q3. Sort Array of Strings Problem Statement Given an array of strings ARRSTR[] of si...read more
Snap-on Business Solutions Full Stack Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits