Digits vs Letters Code in C Language

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Digits vs Letters

Code in C Language

Tests
Executions
main.c
There's a challenge going on in the arena. The champion of
all digits versus the champion of all letters. Fans, digits and
letters alike, all over the land come and watch the battle of
CE Run Tests
the legends!
Test Cases
I want you to count the letters and the digits of the string
inputted. Note that the string may also contain onlookers
like spaces and other special characters. Then output first
the ones who have more in number than the other. Example
O Test Case 1
when the number of digits is 25 where the number of
Your Output
letters is 36, I want you to print it as such: Letters 36 -
Digits 25. Similarly when it turns out that the digits lead in
number, print them first. If they are equal, just print the
digits first.
No Output
Expected Output
Enter string: sneur 3r34w4t $gdr&dr2#g864d sr
Input
Letters 17 - Digits 8
1. String of fans
Description
This includes numbers, digits, spaces, and special
characters.
O Test Case 2
Constraints
Length of the string does not exceed 100.
Sample
O Test Case 3
sneur 3r34w4t $gdr&dr2#g864d sr
O Test Case 4
Output
O Test Case 5 Hidden
Enter string: sneur 3r34w4t $gdr&dr2#g864d sr
Letters 17- - Digits 8
O Test Case 6
Hidden
Transcribed Image Text:Tests Executions main.c There's a challenge going on in the arena. The champion of all digits versus the champion of all letters. Fans, digits and letters alike, all over the land come and watch the battle of CE Run Tests the legends! Test Cases I want you to count the letters and the digits of the string inputted. Note that the string may also contain onlookers like spaces and other special characters. Then output first the ones who have more in number than the other. Example O Test Case 1 when the number of digits is 25 where the number of Your Output letters is 36, I want you to print it as such: Letters 36 - Digits 25. Similarly when it turns out that the digits lead in number, print them first. If they are equal, just print the digits first. No Output Expected Output Enter string: sneur 3r34w4t $gdr&dr2#g864d sr Input Letters 17 - Digits 8 1. String of fans Description This includes numbers, digits, spaces, and special characters. O Test Case 2 Constraints Length of the string does not exceed 100. Sample O Test Case 3 sneur 3r34w4t $gdr&dr2#g864d sr O Test Case 4 Output O Test Case 5 Hidden Enter string: sneur 3r34w4t $gdr&dr2#g864d sr Letters 17- - Digits 8 O Test Case 6 Hidden
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education