It18111 - Programming For Problem Solving Laboratory EX - NO: 6.a Date
It18111 - Programming For Problem Solving Laboratory EX - NO: 6.a Date
EX.NO: 6.a
DATE:
Solving problems using Strings
QUESTION:
Reshmi is given the task of printing the frequency of the digits that occur in the given string starting
from 0 to 9. Help her out to solve the same using C language.
Eg: b1n33m6769
O/p: 0 1 0 2 0 0 2 1 0 1
AIM:
ALGORITHM:
PROGRAM:
Testcase:1
Enter the string f946v4h81202
1120201011
Testcase:2
Enter the string k984084nt2xgd7
1010200121
RESULT:
QUESTION:
Kavi was working in a project at Hakuna Mattata Technologies Ltd. She was given a task of
creating password for the users. The conditions to create the password are as follows:
It should be 8 characters long. First two characters are the first and last characters of the
First name. Next 4 characters are the year of birth of the user. Last two characters are the last and
first characters of the Last name. Note: The password should retain the case of the input.
Eg:
Enter First Name: Rajiv
Enter Last Name: Shukla
Enter Year of Birth: 1985
O/p: Rv1985aS
AIM:
ALGORITHM:
RESULT:
EX.NO: 6.c
DATE:
QUESTION:
Write a program to print the string in the following pattern
h
he
hel
hell
hello
hello
hell
hel
he
h
AIM:
ALGORITHM:
RESULT:
EX.NO: 6.d
DATE:
Solving problems using Strings
QUESTION:
Input:
The first line consists of T, denoting the number of test cases. Next follow T lines, each line
consisting of a string of lowercase English alphabets.
Output:
For each string , you need to find out whether it is a palindrome or not. If it is not a palindrome,
print NO.
If it is a palindrome, print YES followed by a space; then print EVEN it is an even palindrome else
print ODD.
Output for each string should be in a separate line. See the sample output for clarification.
I/p:
3
abc
abba
aba
O/p:
NO
YES EVEN
YES ODD
AIM:
ALGORITHM:
RESULT: