C Level 2 QP
C Level 2 QP
Write a program that prompts the user to enter a positive integer 'n.' Your program should then generate and display
the first 'n' numbers of the Fibonacci series. For example, if the user enters '5,' the program should
output: 0,1,1,2,3,. If n is not a positive number then print Invalid Input.
Sample Input 1:
Sample Output 1:
0,1,1,2,3,
Sample Input 2:
-5
Sample Output 2:
Invalid Input
Scenario:
In a small village fair, children participate in a game where they select a number of two different ranges. The
game master, with enthusiasm, announces that a special prize awaits those who choose a prime number. Excitement
fills the air as the children eagerly search for their lucky prime picks. The program needs to efficiently use a for
loop to iterate through possible prime numbers and determine the smallest 5 primes greater than
the user's input.
Task:
Craft a program that prompts a user to input an integer, find the smallest 5 prime number greater
than a given input, and output the result. (The statements inside brackets are for your
understanding purpose only)
Sample Input :
10 (Input)
Sample Output :
13
17
19
23
As the program runs, it prompts Alex to input a number, and magically, the code reveals whether the
number is a prime or composite, unlocking the hidden knowledge within the ancient book. Excited,
Alex shares the program with friends, turning an ordinary day into an extraordinary adventure of
code-breaking and discovery.
Task :
Craft a program that prompts the user to input a number. The program should then determine
whether the entered number is a prime or composite number.
(The statements inside brackets are for your understanding purpose only)
SAMPLE INPUT 1:
7 (input)
SAMPLE OUTPUT 1:
7 is a prime number
SAMPLE INPUT 2:
12 (input)
SAMPLE OUTPUT 2:
12 is a composite number
A software developer working on a project for a mathematics education platform. The platform
aims to provide students with interactive tools to explore and understand various mathematical
concepts. Your current task is to develop a program that calculates the sum of a series based on user
input. The series is defined by taking the next term and the number of terms from the user. The
program should be user-friendly, efficient, and capable of handling different types of series.
Task:
Craft a program that prompts the user to input the next term of a series and the number of terms
in the series. The program then calculates the sum of the series and displays it along with the series
itself.
(The statements inside brackets are for your understanding purpose only)
Sample Input 1:
3 (Next term)
4 (Number of terms in series)
Sample Output 1:
3 + 33 + 333 + 3333 (The series)
3702 (sum of the series)
Sample Input 2:
5
3
Sample Output 2:
5 + 55 + 555
615
Imagine you have a mysterious code that takes an integer input from the user, finds its positive
divisors, calculates their sum, and finally checks if the sum is equal to the original number. This code
has a secret power to identify whether the number entered by the user is equal or not based on the
sum of its divisors.
Task:
Craft a program to prompt the user to input a number.A loop is used to find and display the
positive divisors of the entered number. If a number i is a divisor, it is printed, and its value is added
to the sum.After finding and displaying all the divisors, it prints the sum of the divisors.Finally, it
checks if the sum is equal to the original number and prints a output
(The statements inside brackets are for your understanding purpose only)
Sample Input 1:
Sample Output 1:
1 2 3 (positive divisors)
6 is an equal number
Sample Input 2:
42
Sample Output2:
1 2 3 6 7 14 21
54
SCENARIO:
In the quiet town of Mathville, where numbers roamed freely and equations danced in the air,
there lived a young programmer named Alex. Alex had a knack for solving numerical puzzles and
unravelling the mysteries hidden within the digits. One sunny afternoon, as Alex sat in front of their
computer, a riddle whispered through the digital winds. It spoke of abundant numbers, those elusive
integers whose divisors danced in a sum greater than the numbers themselves. Intrigued, Alex set
out on a quest to craft a program that could decipher the abundant numbers from the ordinary.
Task:
Craft a program that prompts the user to enter the input. An abundant number is a positive
integer for which the sum of its proper divisors (excluding itself) is greater than the number itself.
Your program should be able to take an integer input from the user and check whether a given
integer number is an abundant number or not.
abundant number :
(i.e) 12
1+2+3+4+6=16
16>12
12 is Abundant number
(The statements inside brackets are for your understanding purpose only)
Sample Input 1:
12 (Input)
Sample Output 1:
Sample Input 2:
7 (Input)
Sample Output 2:
SCENARIO:
Once upon a time, in a quaint little town, there was a community of curious individuals who loved
exploring the mysteries of time. In this town, a group of friends was fascinated by the concept of leap
years, those magical extra days that appear every four years. Determined to understand more about
leap years, they decided to create a program that not only identified whether a given year was a leap
year but also counted the number of leap and non-leap years in the upcoming decade.
Task:
The friends gathered around their computers, determined to create a program that would take a
user-inputted year, determine if it was a leap year, and then count the number of leap and non-leap
years in the next decade.
(The statements inside brackets are for your understanding purpose only)
Sample Input 1:
2022 (Input-year)
Sample Output 1:
Sample Input 2:
2020 (Input-year)
Sample Output 2:
Leap Years: 2
Non-Leap Years: 8
Sample Input 1:
6 (Number of Terms in the series)
Sample Output 1:
1.97 (Sum of the Geometric series)
Sample Input 2:
-1
Sample Output 2:
0.00
Scenario:
Developing a C program to calculate the sum of the squares of the first N natural numbers using
nested while loops. This program should prompt the user to input the value of N and then iteratively
compute the sum by squaring each natural number from 1 to N and adding them together.
Task:
Craft a program that prompts the user to input a positive integer N. Calculate the sum of the squares
by squaring each natural number from 1 to N and adding them together.Ensure the program handles
invalid inputs if N is less than or equal to 0 then Handle the input as “Invalid inputâ€
(The statements inside brackets are for your understanding purpose only)
Sample Input 1:
5 (input)
Sample Output 1:
55 (sum of Squares till 5)
Sample Input 2
-10
Sample Output 2:
Invalid input
Sample Input : 1
10 (The value of N in the series)
Sample Output : 1
2.93
Sample Input : 2
-15
Sample Output : 2
Invalid Input
Sample Input : 1
47580 (input number)
Sample Output : 1
5 (number of digits)
Sample Input : 2
-234
Sample Output : 1
3
Sample Input : 1
3 (Size of the rows and columns - square)
Sample Output : 1
###
###
###
Sample Input : 2
-10
Sample Output : 2
-10 is Invalid input.
Scenario:
Imagine you are developing a program to generate a pyramid pattern with numbers increased by 1.
Users will input the number of rows they want in the pyramid. The program will then display a
triangular pattern where each row contains consecutive numbers starting from 1.
Task:
Craft a program that takes user input for the number of rows and generates a pyramid pattern with
increasing numbers. The numbers should start from 1 and increment by 1 in each row. Handle the
negative integer and 0 by printing “Invalidâ€
(The statements inside brackets are for your understanding purpose only)
Sample Input : 1
4 (Number of Rows)
Sample Output : 1
1
23
456
7 8 9 10
Sample Input : 2
-3
Sample Output : 2
Invalid
Scenario:
Tom is an enthusiastic programmer, and was challenged by his friend Alice to program a program
that swaps the first and last digits of a given number. Tom, always up for a coding challenge, decided
to create a program that not only accomplishes the task but also ensures it handles various cases,
such as numbers with less than two digits. With determination and a cup of coffee, Tom embarked on
the coding journey.
Task:
Craft a program that prompts the user to input a number. Then it swaps the first and last digits of
the given number.
(The statements inside brackets are for your understanding purpose only)
Sample Input : 1
12345 (input)
Sample Output : 1
52341 (After swapping first and last digits)
Sample Input : 2
798456
Sample Output : 2
698457
Scenario:
Imagine you are designing a program for a mathematical enthusiast who wants to explore the world
of perfect cubes. The program takes user input and prints the cubes of the three consecutive
numbers starting from the provided input. However, it also checks if the input is a positive integer,
providing an "Invalid" message otherwise.
Task:
Craft a program that prompts the user to input a number, checks if it's positive, and if so, prints the
cubes of the three consecutive numbers (starting from the given number) and Handle the Negative
number and 0 by printing "Invalid".
(The statements inside brackets are for your understanding purpose only)
Sample Input : 1
10 (Input)
Sample Output : 1
1000 (Cube of 10)
1331 (Cube of 11)
1728 (Cube of 12)
Sample Input : 2
-5
Sample Output : 2
Invalid
Scenario:
You are developing a program that converts numbers to Roman numerals for a user interface. The
program should take a positive integer as input and provide the corresponding Roman numeral
output. Your goal is to implement and the user should be able to interactively input a number.
Task:
Craft a program that converts a given positive integer in a given range (1 to 40) and provides the
corresponding Roman numeral output.If the given number is non positive number or greater than 40
then it should print as “Invalid inputâ€.
I - 1, IV - 4, V - 5, IX - 9, X -10, XL - 40 take as reference
(The statements inside the brackets are for understanding purpose only)
SAMPLE INPUT 1:
37 (Input)
SAMPLE OUTPUT 1:
XXXVII
SAMPLE INPUT 2:
56
SAMPLE OUTPUT 2:
Invalid input
Scenario:
Tom is a computer science student who is learning C programming. His instructor has given him a
task to write a program that displays the first n terms of odd and even natural numbers up to a given
limit n and calculates their respective sums. Tom is excited to work on this task as it will help him
reinforce his understanding of loops, conditionals, and basic arithmetic operations in C
programming.
Task:
Craft a program that prompts the user to enter a value n and then displays the first n terms of odd
and even natural numbers along with their sums.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
5 (input - number of terms starting from 1)
Sample Output 1:
9 (odd sum)
6 (even sum)
Sample Input 2:
2 (input)
Sample Output 1:
1 (odd sum)
2 (even sum)
Task:
Craft a program that prompts the user to input an integer, and counts the number of digits in the
input number, calculates the sum of each digit raised to the power of the total number of digits, and
finally checks if the result equals the original number. Print whether the number is narcissistic or
not.
Hint:
153 = 1^3 + 5^3 +3^3 where 3 in power is the number of digits in the given number
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
153 (Integer)
Sample Output 1:
153 is a narcissistic number
Sample Input 2:
126 (Integer)
Sample Output 2:
126 is not a narcissistic number
Task:
Craft a program that prompts the user to input an integer. It then proceeds to calculate the sum of
even and odd digits within that integer using a while loop. Depending on whether the extracted digit
is even or odd, it is added to the respective sum variables. Finally, the program prints out the sums
of even and odd digits. Assume the number of digits may vary in size upto a maximum of 10 digits.
Hint:
Extract the each digit of the integer, and check whether the digit is even or odd.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
123456 (Enter an integer)
Sample Output 1:
12 (Sum of even digits)
9 (Sum of odd digits)
Sample Input 2:
5627
Sample Output 2:
8
12
Task:
Craft a program starts by taking input for the number of rows in the triangle, denoted by 'N'. Then, it
iterates through each row, printing consecutive alphabet characters starting from 'A'. After printing
each row, it moves to the next character and the next line until the triangle is complete for that test
case. If the given input is less than or equal to zero, then print the output as “Invalidâ€.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1 :
3 (number of rows)
Sample Output 1 :
A
BB
CCC
Sample Input 2 :
0
Sample Output 2 :
Invalid
SCENARIO:
Sarah is fascinated by numbers and patterns. She's particularly interested in palindromic numbers,
those that read the same forwards and backwards. One day, she decided to write a program that
would take an integer from the user and find the next palindrome greater than that integer. Excited
to see how her program performs, she eagerly awaits the results.
Task:
Craft a program that prompts the user to enter an integer. Find the next palindrome number which
is greater than the given integer.Print the next palindrome number as output.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
123 (input)
Sample Output 1:
131 (Next Palindrome number greater than input)
Sample Input 2:
4567
Sample Output 2:
4664
Task:
Craft a program that prompts the user to enter a starting number and then generates next five
palindromic numbers one by one , using loops only.
Hint:
Focus on reversing the digits of a number and comparing it with the original number to determine if
it's a palindrome.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
10
Sample Output 1:
11 22 33 44 55
Sample Input 2:
99
Sample Output 2:
99 101 111 121 131
Task:
Craft a program that generates a palindromic right-angled triangle based on the input provided by
the user. The program should take the number of rows as input and then print the triangle according
to the specified pattern.It then iterates through each row, printing numbers in ascending order from
1 to the current row number.After printing the ascending numbers, it prints the descending
numbers, forming a palindrome with the ascending numbers as the middle.The program continues
this pattern for each row until the desired number of rows is reached. If the given input is less than
or equal to zero, then print the out as “Invalidâ€.
Hint:
This program will print a palindromic right-angled triangle where each row consists of numbers in
ascending order followed by the same numbers in descending order.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
6
Sample Output 1:
1
232
45654
7 8 9 10 9 8 7
11 12 13 14 15 14 13 12 11
16 17 18 19 20 21 20 19 18 17 16
Sample Input 2:
-4
Sample Output 2:
Invalid
Task:
Craft a program that prompts the user to input a positive integer. The program then iterates through
numbers from 1 to the given number, checking if each number is a palindrome (reads the same
forwards and backwards). If a number is a palindrome, it adds it to the sum. Finally, the program
prints out the sum of all palindrome numbers less than or equal to the given positive integer.
Hint:
You'll need to reverse the digits of each number to check if it's a palindrome and sum all palindrome
numbers upto given number as output.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
10
Sample Output 1:
45
Sample Input 2:
99
Sample Output 2:
540
Task:
â— Create a program that gets the rows from the user
◠Display “Invalid†if the rows are less than 1
â— Print the number of rows with the multiples of 5
â— It should increase as the row increases
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
6 (number of rows)
Sample Output1 :
5
5 10
5 10 15
5 10 15 20
5 10 15 20 25
5 10 15 20 25 30
Sample Input 2:
1 (number of rows)
Sample Output 2:
5
Task:
Craft a program that interacts with the user to obtain an integer input. Based on whether the input is even or odd, the
program should generate a series of squares. If the input is even, the program should print squares of even numbers up
to the entered number. If the input is odd, it should print squares of odd numbers up to the entered number.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
6 (input value)
Sample Output 1:
4 16 36
Sample Input 2:
11
Sample Output 2:
1 9 25 49 81 121
Task:
Craft a program prompts the user to enter the number of rows for the right-angled triangle. Then, it iterates over each
row and checks whether the row number is prime or not. If it's prime, it prints '*' for that row.
(The statements inside the brackets are for understanding purpose only)
Note : 1 is not a Prime Number, and every asterisk(*) as a white space at last.
Sample Input 1:
6 (Input)
Sample Output 1 :
**
***
*****
Sample Input 2:
10
Sample Output 2 :
**
***
*****
*******
Task:
Craft a program to find the LCM of two given numbers. Your program should take user input for two positive integers, if
any of the input is negative then print Negative Input else perform the LCM calculation, and then print the result.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
Sample Output 1:
36
Sample Input 2:
12 14
Sample Output 2:
84
In a quaint little town, there lived a curious detective named Sam. Sam wasn't your typical detective;
instead of solving mysteries of thefts or murders, Sam was fascinated with numbers. One day, while
sipping coffee at his favorite café, Sam overheard a conversation about perfect numbers – those
magical digits whose divisors add up to the number itself. Intrigued, Sam decided to embark on a
quest to create a program that could detect perfect numbers and unveil their largest divisor.
Task:
Craft a program prompts the user to input a number. Then iterates through all the numbers (from 1)
less than the input number to find its divisors, add the divisors. If the sum is equal to the same
number then it is perfect number. Check whether the given number is perfect or not and if the given
number is perfect then find the largest divisor of the given number else print the given number as it
is and print the output
Hint:
Consider using loops to iterate through all possible divisors of the given number and keep track of
the sum of divisors and the largest divisor found.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
6
Sample Output 1:
3
Explanation:
Divisors of 6 are 1,2 and 3. The sum of 1,2, and 3 is 6 which is equal to the given number 6. So, it is
perfect number. So, 3 is the largest divisor.
Sample Input 2:
10
Sample Output 2:
10
Explanation:
Divisors of 10 are 1,2 and 5. The sum of 1,2, and 5 is 8 which is not equal to the given number
10. So, it is not perfect number. So, print the same number 10 as output.
Task:
Craft a program that prompts the user to input the total number of people attending an event. The
program should then simulate handshakes between each pair of people and Count the total number
of handshakes that occur. Print out the total number of handshakes.
Hint:
Think about how you can iterate through each person and pair them with every other person to
simulate handshakes.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
6 (Input)
Sample Output 1:
15 (total number of handshakes)
Sample Input 2:
10 (Input)
Sample Output 2:
45 (total number of handshakes)
Task:
Craft a program first prompts the user to enter a limit. Then it checks whether the limit is even or odd using the modulo
operator (%). After that, it uses loops to print out the series of even or odd numbers up to the limit, depending on the
input provided by the user. If the limit is less than or equal to 0 then print Not a Positive integer
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
9 (limit)
Sample Output 1:
1 3 5 7 9 (Odd numbers)
Sample Input 2:
Sample Output 2:
24
Task:
Craft a program should prompt the user to input an integer, then repeatedly sum its digits until the
sum becomes a single digit. Finally, it should output this single digit sum.
Hint:
Focus on how the code iteratively sums the digits of the input number until it becomes a single digit.
(The statements inside the brackets are for understanding purpose only)
Sample Input:
9876 (Input)
Sample Output:
3 (Sum of digits)
Explanation:
9+8+7+6 = 30 = 3+0 =3
Sample Input:
12345
Sample Output:
6
Task:
Craft a program that counts the number of vowels in a user-provided input. The program should prompt the user to
enter a word, read the input character by character, and increment a counter for each vowel encountered. After
reading the entire input, it should display the total count of vowels found.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
Bestfriends
Sample Output 1:
Sample Input 2:
Heelloo
Sample Output 2:
Task:
Craft a program that takes an integer input from the user.Store the original number and iterate
through each digit of the number. For each digit, add 1 and store the modified digit (if the digit is 9,
it becomes 0).Accumulate the modified digits to form the result. Output the modified numbers.
Hint:
Increment each digit of the input number by 1.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
245
Sample Output 1:
356 (Modified number)
Sample Input 2:
9876
Sample Output 2:
987
Task:
Craft a program that prompts the user to input the number of rows for the pattern. To generate a pattern of numbers in
reverse order. Each row should display numbers starting from the row number down to 1. If the input number is less
than or equal to zero then print Invalid Input
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
4 (input no of rows)
Sample Output 1:
1234
123
12
1
Sample Input 2:
Sample Output 2:
123
12
1
Note : There is a white space at end of every number and no new line is present after the last row.
Task:
Craft a program prompts the user to enter an odd number.It checks if the entered number is odd and
greater than zero. If not, it prompts the user to enter a valid odd number.Once a valid odd number is
entered, the program calculates its factorial using a loop.The factorial is calculated by multiplying all
odd numbers from 1 up to the entered odd number. Finally, the program prints the factorial of the
input number. If the given input is even then print as “Please enter a valid odd numberâ€
otherwise whether the input is less than 1,then print as “Invalidâ€.
Hint:
Utilize a loop to multiply all odd numbers up to the given odd number to calculate its factorial.
(The statements inside the brackets are for understanding purpose only)
Sample Input:
5 (Input)
Sample Output:
15 (Factorial of 5)
EXPLANATION
calculates the factorial of 5 (1 * 3 * 5) = 15
Sample Input:
6
Sample Output:
Please enter a valid odd number
Scenario :
In a mathematics workshop, students are exploring series expansion techniques. As part of the
session, they are intrigued by a particular series: 1 -(x^2)/2! + (x^4)/4! - (x^6)/6! + ... They want to
develop a program to find the sum of this series.
Task :
The students are tasked with Craft, a program that calculates the sum of the series 1 - (x^2)/2! +
(x^4)/4! - (x^6)/6! + ... The program should prompt the user to input the value of 'x' and the number
of terms 'n' in the series.
(The statements inside the brackets are for understanding purpose only.)
Sample Input : 1
7 (Value of X)
5 (Number of Terms)
Sample Output : 1
56.12 (Sum of the series)
Sample Input : 2
4 (Value of X)
7 (Number of Terms)
Sample Output: 2
-0.65 (Sum of the series)
Jack, an amateur programmer, is fascinated by the Fibonacci sequence and its properties. He wants
to create a program that generates even Fibonacci numbers up to a given limit. Inspired by his
curiosity, he starts working on a simple C program to achieve this goal. With his determination and a
few cups of coffee, Jack dives into coding.
Task:
Craft a program that prompts the user to enter a limit, then generates Fibonacci numbers up to that
limit and prints only the even numbers from the series. For zero and negative number print "Invalid".
Hint:
Use a loop to generate Fibonacci numbers and check each number if it's even before printing.
Sample Input 1:
5
Sample Output 1:
02
Sample Input 2:
-2
Sample Output 2:
Invalid
Task:
Craft a program that takes input from the user for the number of terms in the series and the initial
term. The program should then calculate and print the subsequent terms of the series, where each
term is obtained by multiplying the previous term by 2.Finally, the program prints the output.
Hint:
The key to this task lies in understanding how to generate the subsequent terms of the series by
multiplying each term by 2.
(The statements inside the brackets are for understanding purpose only)
Sample Input 1:
5 (number of terms)
3 (series starting value)
Sample Output 1:
3 6 12 24 48
Sample Input 2:
4
2
Sample Output 2:
2 4 8 16
Task:
Craft a program that prompts the user to input an integer. Find the prime factors of the given
number and display their sum.
Hint : A number’s factors which are prime numbers are prime factors
(The statements inside the brackets are for understanding purpose only)
Sample Input : 1
36 (Number)
Sample Output : 1
10 (Sum of Prime Factors)
Sample Input : 2
52 (Number)
Sample Output : 2
17 (Sum of Prime Factors)
Sample Input : 1
5 (Value of N)
Sample Output : 1
1 3 5 7 9 (Natural numbers)
25 (Sum of 5 odd natural numbers)
Sample Input : 2
7 (Value of N)
Sample Output : 2
1 3 5 7 9 11 13 (Natural numbers)
49 (Sum of 7 odd natural numbers)
Scenario :
In a data analysis project, you're tasked with developing a program to determine if a user-defined
range is even. If the range is indeed even, the program must then identify and output the second
even number within that range.
Task:
Craft a program that prompts the user to input a range. Upon verification that the range is even,
utilize loops to identify and print the second even number within the specified range.
(The statements inside the brackets are for understanding purpose only)
Sample Input : 1
14 20 (Starting & Ending number)
Sample Output : 1
16 (Second even number)
Sample Input : 2
15 41 (Starting & Ending number)
Sample Output : 2
15 and 41 are not Even.
Sample Input : 1
4 (Rows for Floyd)
Sample Output : 1
1
23
456
7 8 9 10
Sample Input : 2
-2 (Rows for Floyd)
Sample Output : 2
Invalid
Scenario :
As the mathematics club gathered, they set up a challenge to find Automorphic Numbers. Curious
students eagerly examined their chosen digits, hoping to discover the magical numbers where the
square of the number ends with the same digits. A triumphant cheer echoed as participants
successfully identified these intriguing Automorphic Numbers.
Task:
Given an integer input as the number, the objective is to check whether or not the number is an
automorphic number. First, square the input number and check if the number has been repeated in
the same order of digits at the end of its square, whether it is an automorphic number or not.
Example:
25 is an automorphic number because 25^2 = 625, and the last two digits of 625 are 25.
23 is not an automorphic number because 23^2 = 529, and the last two digits are not 23.
(The statements inside the brackets are for understanding purpose only.)
Sample Input : 1
6 (Number)
Sample Output : 1
6 is an Automorphic Number.
Sample Input : 2
7 (Number)
Sample Output : 2
7 is not an Automorphic Number.
Sample Input : 1
12345 (Value)
Sample Output : 1
6 (Sum of first and last digit)
Sample Input : 2
78956
Sample Output : 2
13 (Sum of first and last digit)
Sample Input : 1
20 (Integer)
Sample Output : 1
110 (Sum of even numbers)
Sample Input : 2
-12 (Integer)
Sample Output : 2
-12 is an Invalid number.
Sample Input : 1
6 (Number)
Sample Output : 1
8 (Number of steps taken)
Sample Input : 2
25 (Number)
Sample Output : 2
23 (Number of steps taken)
Sample Input : 1
14562 (Value)
Sample Output : 1
15 (Sum of middle digits)
Sample Input : 2
10254823 (Value)
Sample Output : 2
21 (Sum of middle digits)
Sample Input : 1
96387 (Input)
Sample Output : 1
78369 (Output)
Sample Input : 2
00710.823 (Input)
Sample Output : 2
17 (Output)
Sample Input: 1
16.00 (Input)
Sample Output : 1
16 is a Perfect Square.
Sample Input : 2
02.53 (Input)
Sample Output : 2
2 is not a Perfect Square.
Sample Input : 1
5 (Number of Rows)
Sample Output : 1
A
AB
ABC
ABCD
ABCDE
Sample Input : 2
30 (Number of Rows)
Sample Output : 2
30 is an Invalid input.
Sample Input : 1
6 (Number of Rows)
Sample Output : 1
5
5 10
5 10 15
5 10 15 20
5 10 15 20 25
5 10 15 20 25 30
Sample Input : 2
1 (Number of Rows)
Sample Output : 2
5
Sample Input : 1
1258 (Value)
Sample Output : 1
80 (Output Product)
Sample Input : 2
12508 (Input Value)
Sample Output : 2
Invalid Input. (Output)
Sample Input : 1
10 (Starting Range)
25 (Ending Range)
Sample Output : 1
11 13 17 19 23 (Output)
Sample Input : 2
2 (Starting Range)
5 (Ending Range)
Sample Output : 2
2 3 5 (Output)
Sample Input : 1
18 (Input)
Sample Output : 1
18 is Harshad number. (Output)
Sample Input : 2
99 (Input)
Sample Output : 2
99 is Not Harshad number. (Output)
Sample Input : 1
1 (Input)
Sample Output : 1
1 is a Strong Number.
Sample Input : 2
4534 (Input)
Sample Output : 2
4534 is Not a Strong Number.
Sample Input : 1
33233 (Input)
Sample Output : 1
33233 is Palindrome. (Output)
Sample Input : 2
3214 (Input)
Sample Output : 2
3214 is Not a Palindrome. (Output)