Data Structure Lab(25CS151)
Programs List
1.1 Largest of Three Numbers
Write an Algorithm to input three numbers and
Problem
determine which number is the largest among them
Statemen
t
-
Input
Format
Output -
Format
Sample -
Input
Sample -
Output
1.2 Leap Year
Write an Algorithm to check whether the user input year
Problem
is Leap year or not.
Statemen
t
-
Input
Format
Output -
Format
Sample -
Input
Sample -
Output
1.3 Sum of digits
Draw a Flow-Chart to display the sum of digits of 4
Problem
digits user input number.
Statemen
t
-
Input
Format
Output -
Format
Sample -
Input
Sample -
Output
2.1 Swapping of two numbers
Write a program to input two numbers and display the
Problem
numbers after swapping their values.
Statemen
t
First line of input contains the two integers denoting
Input
the value of a a n d b .
Format
Output Display numbers after swapping in a single line.
Format
Sample 59
Input
Sample 95
Output
2.2 Salary Calculation
Basic salary of an employee is input through the
Problem keyboard. The DA is 25% of the basic salary while the
Statemen HRA is 15% of the basic salary. Provident Fund is
t deducted at the rate of 10% of the gross salary
(BS+DA+HRA). Program to calculate the Net Salary.
First line of input contain the integers denoting
Input
the value of Basic Salary.
Format
Output Display the Net Salary
Format
Sample 10000
Input
Sample 14600
Output
2.3 Sum of digits
Write a program to input 4-digits number and display
Problem the sum of digits.
Statemen
t
First line of input contain the 4 digits integers
Input
Format
Output Display the sum of digits
Format
Sample 4587
Input
Sample 24
Output
3.1 Largest of Three Numbers
Write a program to input three
Probl
numbers and determine which
em
number is the largest among
State
[Link] Ternary Operator
ment
First line of input contains the
Input
three integers denoting the
Form
value of a , b a n d c .
at
Outp Largest integer in a single line.
ut
Form
at
Samp 5 9 2
le
Input
Samp 9
le
Outp
ut
3.2 Leap Year
Write a program to input a year and check the input
Problem
year is leap year or not using ternary Operator.
Statemen
t
First line contains the integer denotaing the year
Input
Format
Output Display the result either Leap year or Not a Leap
Format Year.
2024
Sample
Input
Sample Leap Year
Output
3.3 4 digits Palindrome Number
Write a program to input a 4 digits number and check
Problem
the input number is palindrome or not using ternary
Statemen
Operator.
t
First line contains the integer denotaing the 4 digits
Input number
Format
Output Display the result either Yes or No.
Format
1331
Sample
Input
Sample Yes
Output