Lab programs with flowchart, algorithm and code
Every program comes with its flowchart, step-by-step algorithm, pseudocode, code in C, Python and Java, a dry run with a trace table, and viva questions.
Basics
- Sum of Two Numbers
- Swap Two Numbers
- Swap Without a Third Variable
- Area of a Circle
- Simple Interest
- Compound Interest
- Celsius to Fahrenheit
- Area of a Triangle (Heron’s Formula)
Decisions (if / else)
- Even or Odd
- Positive, Negative or Zero
- Largest of Two Numbers
- Largest of Three Numbers
- Leap Year
- Vowel or Consonant
- Grade of a Student
- Roots of a Quadratic Equation
- Simple Calculator (switch)
- Valid Triangle Check
- Profit or Loss
- Electricity Bill
Loops and numbers
- Sum of First n Natural Numbers
- Factorial of a Number
- Fibonacci Series
- Prime Number Check
- Prime Numbers in a Range
- Reverse a Number
- Palindrome Number
- Sum of Digits
- Count the Digits
- Armstrong Number
- Perfect Number
- Strong Number
- GCD (HCF) of Two Numbers
- LCM of Two Numbers
- Multiplication Table
- Power of a Number
- Decimal to Binary
- Binary to Decimal
- Sum of Even Numbers up to n
- Sum of the Series 1 + 1/2 + … + 1/n
- Perfect Square Check
- Prime Factors of a Number
- Neon Number
- Harshad (Niven) Number
- Automorphic Number
- Count Down with a While Loop
Patterns
- Right Triangle Star Pattern
- Pyramid Star Pattern
- Number Triangle Pattern
- Floyd’s Triangle
- Pascal’s Triangle
- Inverted Triangle Star Pattern
Arrays
- Largest Element in an Array
- Smallest Element in an Array
- Sum and Average of an Array
- Reverse an Array
- Second Largest in an Array
- Count Even and Odd Numbers in an Array
- Frequency of an Element in an Array
- Remove Duplicates from an Array
- Merge Two Arrays
- Rotate an Array Left by One
Searching and sorting
Strings
- Length of a String (without strlen)
- Reverse a String
- Palindrome String
- Count Vowels in a String
- Convert a String to Uppercase
- Frequency of a Character
- Count Words in a Sentence
- Anagram Check