[go: up one dir, main page]

0% found this document useful (0 votes)
9 views2 pages

String Questions

The document outlines a series of programming tasks involving string manipulation and formatting. Tasks include checking string length, validating numeric characters, formatting name and roll number, separating components of a combined input, capitalizing words in a sentence, and parsing a date format. The tasks are presented in order of difficulty, with hints provided for certain operations.

Uploaded by

raneerizal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

String Questions

The document outlines a series of programming tasks involving string manipulation and formatting. Tasks include checking string length, validating numeric characters, formatting name and roll number, separating components of a combined input, capitalizing words in a sentence, and parsing a date format. The tasks are presented in order of difficulty, with hints provided for certain operations.

Uploaded by

raneerizal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Input a string and find if its length is greater or less than 10.

2. Input a string and check if all the characters are numbers or


not.
3. Ask for name and roll number and display them together
separated by #
eg. If input name is Amar and roll no is 4222
output: 4222#Amar
4. Ask for roll number and name together and display
separately. first four characters should be digits and the rest
will be name. You need not validate, just assume the input
format is correct.
eg. Input 4222Amar
output: Name: Amar
Roll: 4222
5. Input a sentence and capitalize the first characters of each
words.
example: Input: this is class 9B
Output: This Is Class 9B
**HINT: The first character and every character after space is to
be capatalized.
6. A full date is in the format D-M-Y where D is two digit day, M
is full month(of variable length) and Y is four digit year.
Separate the day, month, and Year and print separately.
eg. Input Output
05-May-2019 Day: 01
Month: May
Year: 2019
06-September-2010 Day: 06
Month: September
Year: 2010
[**Hint** ASCII values for digit 0 to 9 are 48 to 57]
Difficulty order: 1,3,4,6,2,5

You might also like