Previous
0 / 7
Module DEMO-32-58DEMO-C-32

Print Alphabet Sequence

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a C program that reads a lowercase letter from the user and prints all lowercase letters from 'a' up to and including the input letter.

For example, if the user enters 'e', your program should print 'abcde'. If the user enters 'm', your program should print 'abcdefghijklm'.

Requirements:

  • Use a loop to generate the sequence
  • Handle only valid lowercase letters from 'a' to 'z'
  • Print all characters on a single line with no spaces

Constraints

The input will be a single lowercase English letter (a-z) Your solution must use loops (for, while, or do-while) No arrays or advanced data structures allowed Time limit: 1 second

Input Format

A single lowercase letter (from 'a' to 'z') followed by a newline character.

Output Format

A sequence of consecutive lowercase letters starting from 'a' up to and including the input letter, printed on a single line with no spaces.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
e
abcde
Sample case showing sequence from 'a' to 'e'
Sample #2
Public sample
a
a
Edge case with single character output
Sample #3
Public sample
z
abcdefghijklmnopqrstuvwxyz
Sample case showing full alphabet sequence
Sample #4
Public sample
c
abc
Sample case showing short sequence
Sample #5
Public sample
j
abcdefghij
Hidden case testing sequence ending at 'j'

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings