[go: up one dir, main page]

0% found this document useful (0 votes)
5 views25 pages

Study Arham

The document outlines a comprehensive list of programming tasks categorized into various sections including Basics, Number System, Array, String, Stack, and Queue questions. Each section contains specific programming problems along with brief logic or methods to solve them, primarily using C programming. The tasks range from basic arithmetic operations to more complex algorithms and data structure manipulations.

Uploaded by

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

Study Arham

The document outlines a comprehensive list of programming tasks categorized into various sections including Basics, Number System, Array, String, Stack, and Queue questions. Each section contains specific programming problems along with brief logic or methods to solve them, primarily using C programming. The tasks range from basic arithmetic operations to more complex algorithms and data structure manipulations.

Uploaded by

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

Basics Question

1. Addition / Subtraction / Multiplication of Numbers.


2. Percentage Program / Percentage calculator.
3. Simple Interest program
4. Swapping Number.
5. Even/Odd Number.
6. Check consonants or vowels.
7. Character is alphabet or not.
8. Check character vowels or digits.
9. Convert lower to upper case / Convert upper to lower case
10. Profit loss program
11. Program to find ASCII value of character,
12. Program to find the quadrant in which coordinates lie.
13. Program to find Numbers of days in a given months of given years
14. Program to find roots of a quadratic equations
15. Print table of any number
16. Program to find Area of circle / Area of Rectangle.
17. Voting program (allow above 18 years)
18. Program to calculate max number of handshakes.
19. Program to find double of the Number using arithmetic operator
No system question
1. Fibonacci Series
2. Prime number (Optimization Also) / Sum of two prime number
3. Prime number given range
4. Program to find sum of number in given range
5. LCM of two number
6. HCM/GCD of two number
7. Reverse of any number
8. Sum of reverse number / Multiply of reverse number
9. Factorial
10. Armstrong number
11. Palindrome number / Palindrome in a given range like from 1 to 100
12. Prime factor
13. Power of number
14. Swapping of two number
15. Sum of Arithmetic series
16. Sum of Geometric Progression
17. Replace any with another number
18. Leap year
19. Program to add to fractions
20. Largest and smallest number / max and min
21. Area of Circle , Rectangle , Square , Triangle , Sphere
22. Replace any number with other number like 0 with 5
23. Program to find sum of N natural number
24. Program to find the number is perfect or not
25. Abundant number
26. Check number is Positive, Negative, Odd, Even, Zero etc.
27. Replace all zero with one
Array Questions
1. Array Insertion
2. Array Deletion
3. Array Updation
4. Array insertion from specific position
5. Array deletion from specific position
6. Array updation from specific position
7. Max Number of an array
8. Min Number of an array
9. Smallest and Second Smallest Number in array
10. Largest and Second Largest Number in array
11. Frequency of the element in the array
12. Array is the subset of another array
13. Rotation of array by rotate function()
14. Linear search
15. Reverse of array
16. Swapping adjacent number in array
17. Unique element in array
18. Duplicate element in array
16. Union of Array
17. Intersection of array
18. Pair sum of two no ( 1 , 1 ) = 2
19. Pair sum triplet
20. Binary search
21. First Occurrence of array
22. Last Occurrence of array
23. Peak Element of array
24. Pivot of an Array
25. Bubble Sort
26. Selection Sort
27. Insertion Sort
28. Quick Sort
29. Merge Sort
30. Move all zeros
31. Rotate the array (By logic)
32. Longest Palindrome in an array
33. Even and odd number in array
34. [] [] program to check two array same or not
35. Program to remove the brackets from an algebraic expression
String Questions
1. Taking input from string
2. Length of string
3. Reverse a string
4. Check palindrome of string
5. Reverse a word in string
6. Max occurring character in string
7. Replace Empty space in string
8. Removing Substring from string
9. Removing vowels from string
10. Smallest and largest word of string
11. Convert character to opposite case
12. First and last character of string
13. Sort the string
14. Replace the word in string
15. Reverse the string
16. Reverse the whole string
17. Fill the empty space in string
18. Removing duplicate from string
19. Duplicate present in the string
20. Adjacent duplicate
21. Permutation of string
22. Check vowel or not
23. Check given character Alphabet, Lowercase, or Uppercase
24. Convert uppercase to lowercase
25. Palindrome in a string
26. Check for balance parenthesis
27. Lexicographically String
28. Program to copy a string
29. Program to Capitalize first and last letter of string
30. Frequency of character
31. 2 string palindrome or not
32. Program to compare two string
Stack Questions
1. Implement the stack using an array
2. Implement two stacks in one array
3. Reverse a string using stack
4. Delete the middle element from the stack
5. Valid parentheses in stack
6. Reverse the stack
7. Sort the stack

Queue Questions
Implement the queue using an array.
—LEFT—
Star print
2d Array
Recursion
Oops questions
Dbms
Sql
C
Python
Dsa Theory
The logic for each of these tasks in C programming:
1. Addition / Subtraction / Multiplication of Numbers:
- Addition: `result = num1 + num2`
- Subtraction: `result = num1 - num2`
- Multiplication: `result = num1 * num2`

2. Percentage Program / Percentage Calculator:


- percentage = (obtained_marks / total_marks) * 100`

3. Simple Interest program:


- `Simple_Interest = (principal * rate * time) / 100`

4. Swapping Numbers:
- Use a temporary variable to swap values between two variables.

5. Even/Odd Number:
- Checking if a number is even: `if (num % 2 == 0)`

6. Check Consonants or Vowels:


- Use a conditional statement to check if the character matches any vowel.

7. Character is Alphabet or not:


-Use character comparison to check if it falls within the range of alphabet
characters.

8. Check Character Vowels or Digits:


- Checking if a character is a digit or an alphabet: Use character comparison
and digit range checks.
9. Convert Lower to Upper Case / Convert Upper to Lower Case:
- Conversion to upper case: Use the `toupper()` function.
- Conversion to lower case: Use the `tolower()` function.

10. Profit Loss Program:


- Calculate profit or loss based on the difference between selling price and
cost price.

11. Program to find ASCII value of character:


- Find ASCII value using type casting: `(int)character`

12. Program to find the quadrant in which coordinates lie:


- Use conditional statements to determine the quadrant based on the signs
of x and y coordinates.

13. Program to find the number of days in a given month of given years:
- Use conditionals to check the month and account for leap years for
February.

14. Program to find roots of a quadratic equation:


- Calculate the discriminant and use the quadratic formula to find roots.

15. Print table of any number:


- Use a loop to iterate from 1 to 10 (or any desired range) and print the
multiplication results.

16. Program to find Area of circle / Area of Rectangle:


- area_circle = pi * r * r` and `area_rectangle = length * width`.
17.Voting program (allow above 18 years):
- Check if age is greater than or equal to 18 to determine eligibility to vote.

18. Program to calculate the max number of handshakes:


- Use the combinatorial formula `handshakes = n * (n - 1) / 2` to calculate
the number of handshakes for 'n' people.

19. Program to find double of the number using arithmetic operator:


- Simply multiply the number by 2 to find its double: `double_number =
number * 2`.
Number System Questions

1. Fibonacci Series
- Initialize two variables for the first two numbers in the series.
- Use a loop to calculate and print the next numbers in the series by adding
the previous two.

2. Prime Number (Optimization Also) / Sum of Two Prime Numbers


- To check if a number is prime, iterate from 2 to the square root of the
number and check for divisibility.
- For sum of two prime numbers, iterate through numbers and check if both
current and (target - current) are prime.

3. Prime Number in a Given Range:


- Iterate through numbers in the given range and check if each is prime using
the prime checking logic.

4. Program to Find the Sum of Numbers in a Given Range:


- Use a loop to iterate through numbers in the given range and accumulate
their sum.

5. LCM of Two Numbers:


- `LCM(a, b) = (a * b) / GCD(a, b)`.

6. GCD/HCF of Two Numbers:


- Find the Greatest Common Divisor (GCD) or Highest Common Factor (HCF)
of two numbers using Euclidean algorithm.
7. Reverse of Any Number:
- Reverse a number by repeatedly taking the last digit and adding it to the
reversed number while removing the last digit from the original number.

8. Sum of Reverse Number / Multiply of Reverse Number:


- Reverse two numbers as explained above, then add or multiply them.

9. Factorial:
- Calculate the factorial of a number using a loop, multiplying the number by
decreasing values from 1 to the number itself.

10. Armstrong Number:


- Check if a number is an Armstrong number by calculating the sum of its
digits raised to the power of the number of digits.

11. Palindrome Number / Palindrome in a Given Range:


- Check if a number is a palindrome by reversing it and comparing with the
original.
- For a range, iterate through numbers and check for palindromes.

12. Prime Factor:


- Find the prime factors of a number by dividing it repeatedly by prime
numbers (starting from 2).

13. Power of Number:


- Calculate the power of a number using a loop, multiplying the base number
by itself for the desired exponent.
14. Swapping of Two Numbers:
- Swap two numbers using a temporary variable.

15. Sum of Arithmetic Series:


- Calculate the sum of an arithmetic series using the formula `sum = (n / 2) *
(2 * first_term + (n - 1) * common_difference)`.

16. Sum of Geometric Progression:


- Calculate the sum of a geometric progression using the formula `sum =
first_term * (1 - pow(r, n)) / (1 - r)`.

17. Replace Any with Another Number:


- Replace a specific number with another number in an array using a loop and
conditional statements.

18. Leap Year:


- Check if a year is a leap year based on leap year rules.

19. Program to Add Two Fractions:


- Add two fractions by finding a common denominator and then adding the
numerators.

20.Largest and Smallest Number:


- Iterate through a list of numbers to find the largest and smallest numbers.

21. Area of Circle / Rectangle / Square / Triangle / Sphere:


- Use the respective area formulas for each shape based on the input
parameters.
22. Square Free Number:
- Check if a number is square-free (not divisible by any perfect square greater
than 1).

23. Program to Find the Sum of N Natural Numbers:


- `sum = (N * (N + 1)) / 2`.

24. Program to Find Whether a Number is Perfect or Not:


- Check if a number is perfect (equal to the sum of its divisors except itself).

25. Abundant Number


- Check if a number is abundant (sum of its divisors except itself is greater
than the number itself).

26. Check Number is Positive, Negative, Odd, Even, Zero, etc.:


- Use conditional statements to check the properties of a number.

27. Replace All Zeroes with Ones:


- Iterate through a number and replace all occurrences of zero with one.

28. Replace Any Number with Another Number (e.g., 0 with 5):
- Iterate through a number and replace all occurrences of a specific number
with another number.
Array Questions:

1. Array Insertion:
- Insert an element into an array at a specified position by shifting elements
to accommodate the new element.

2. Array Deletion:
- Delete an element from an array at a specified position by shifting
elements to close the gap.

3. Array Updation:
- Update an element in an array at a specified position with a new value.

4. Array Insertion from Specific Position:


- Insert an element into an array at a specific position, pushing elements to
the right.

5. Array Deletion from Specific Position:


- Delete an element from an array at a specific position, pulling elements to
the left.

6. Array Updation from Specific Position:


- Update an element in an array at a specific position with a new value.

7. Max Number of an Array:


- Iterate through an array to find the maximum element.
8. Min Number of an Array:
- Iterate through an array to find the minimum element.

9. Smallest and Second Smallest Number in Array:


- Iterate through an array to find the smallest and second smallest
elements.

10. Largest and Second Largest Number in Array:


- Iterate through an array to find the largest and second largest elements.

11. Frequency of the Element in the Array:


- Count the occurrences of a specific element in an array.

12. Array is the Subset of Another Array:


- Check if one array is a subset of another by iterating and matching
elements.

13. Rotation of Array by Rotate Function() :


- Rotate elements of an array by a specified number of positions using
temporary storage.

14. Linear Search:


- Search for a specific element in an array by iterating through it linearly.

15. Reverse of Array:


- Reverse the elements in an array.
16. Swapping Adjacent Numbers in Array:
- Swap adjacent elements in an array.

17. Unique Element in Array:


- Find unique elements in an array, removing duplicates.

18. Duplicate Element in Array:


- Find duplicate elements in an array.

19. Union of Arrays:


- Find the union (merge) of two arrays, removing duplicates.

20. Intersection of Arrays:


- Find the intersection of two arrays, i.e., common elements.

21. Pair Sum of Two Numbers (e.g., 1+1=2):


- Find pairs in an array whose sum equals a given target.

22. Pair Sum Triplet:


- Find triplets in an array whose sum equals a given target.

23. Binary Search:


- Search for a specific element in a sorted array using binary search.

24. First Occurrence of Array / Last Occurrence of Array:


- Find the first or last occurrence of a specific element in an array.
25. Peak Element of Array:
- Find peak elements in an array (elements greater than their neighbors).

26. Pivot of an Array:


- Find the pivot element in a rotated sorted array.

27. Sorting Algorithms (Bubble, Selection, Insertion, Quick, Merge):


- Implement various sorting algorithms to sort an array.

28. Move All Zeros:


- Move all zeros to the end of an array while maintaining the order of non-
zero elements.

29. Rotate the Array (By Logic):


- Rotate elements of an array to the right or left by a specific number of
positions.

30. Longest Palindrome in an Array:


- Find the longest palindrome substring in an array of characters.

31. Even and Odd Numbers in Array:


- Separate even and odd numbers in an array.

32. Check if Two Arrays are the Same:


- Check if two arrays are identical in content.

33. Remove Brackets from an Algebraic Expression:


- Remove brackets from an algebraic expression and simplify.
String Questions
1. Taking Input from String:
- Accept input as a string from the user or a file.

2. Length of String:
- Calculate the length (number of characters) of a string using a loop.

3. Reverse a String
- Reverse the characters in a string using a loop.

4. Check Palindrome of String:


- Check if a string is a palindrome by comparing it with its reverse.

5. Reverse a Word in String:


- Reverse the order of words in a string.

6. Max Occurring Character in String:


- Find the character that occurs most frequently in a string.

7. Replace Empty Spaces in String:


- Replace all empty spaces in a string with a specified character or another
string.

8. Removing Substring from String:


- Remove a specific substring from a string.

9. Removing Vowels from String:


- Remove all vowels (or specific vowels) from a string.
10. Smallest and Largest Word in String:
- Find the smallest and largest words in a sentence or string.

11. Convert Character to Opposite Case:


- Convert the case of characters (uppercase to lowercase and vice versa).

12. First and Last Character of String:


- Find and print the first and last characters of a string.

13. Sort the String:


- Sort the characters in a string in ascending or descending order.

14. Replace a Word in String:


- Replace a specific word or substring with another word in a string.

15. Reverse the String:


- Reverse the order of characters in each word of a string.

16. Reverse the Whole String:


- Reverse the entire string, including spaces and punctuation.

17. Fill Empty Spaces in String:


- Replace empty spaces with a specific character to make the string of
uniform length.
18. Removing Duplicates from String:
- Remove duplicate characters from a string while maintaining the original
order.

19. Check for Duplicate Characters in String:


- Determine if a string contains any duplicate characters.

20. Adjacent Duplicates in String:


- Remove adjacent duplicate characters from a string.

21. Permutation of String:


- Generate all possible permutations of characters in a string.

22. Check if a Character is a Vowel or Not:


- Determine if a character is a vowel by checking against a list of vowels.

23. Check if a Character is an Alphabet, Lowercase, or Uppercase:


- Determine the type of character (alphabet, lowercase, uppercase) using
conditional statements.

24. Convert Uppercase to Lowercase:


- Convert all uppercase letters in a string to lowercase.

25. Palindrome in a String:


- Find all palindromic substrings within a string.

26. Check for Balanced Parentheses:


- Check if a string with parentheses has balanced parentheses.
27. Lexicographically Compare Two Strings:
- Compare two strings lexicographically (alphabetically).

28. Program to Copy a String:


- Copy the contents of one string to another.

29. Program to Capitalize the First and Last Letter of a String:


- Capitalize the first and last letters of each word in a string.

30. Frequency of Characters:


- Count the frequency of each character in a string.

31. Check if Two Strings are Palindromes of Each Other:


- Determine if two strings are palindromes of each other.

32. Compare Two Strings:


- Compare two strings character by character to check if they are equal or
not.
Stack Questions:

1. Implement the Stack Using an Array:


- Create a stack data structure using an array and implement push, pop,
and other stack operations.

2. Implement Two Stacks in One Array:


- Implement two separate stacks using a single array and manage their
elements accordingly.

3. Reverse a String Using a Stack:


- Reverse the characters of a string using a stack data structure.

4. Delete the Middle Element from the Stack:


- Remove the middle element from a stack without using any additional
data structures.

5. Check for Valid Parentheses in a Stack:


- Check if a given expression with parentheses has a valid closing
arrangement using a stack.

6. Reverse the Stack:


- Reverse the order of elements in a stack using auxiliary data structures.

7. Sort the Stack:


- Sort the elements in a stack in ascending or descending order using an
auxiliary stack.
Queue Questions:

Implement the Queue Using an Array:


- Create a queue data structure using an array and implement enqueue
and dequeue operations.

Other Topics:

Star Print:
- Print patterns of stars or other characters using loops.

2D Array:
- Create and manipulate 2D arrays, perform operations like matrix
multiplication, and traverse elements.

Recursion:
- Implement recursive functions for solving problems, such as factorial
calculation, Fibonacci series, and more.

OOPs (Object-Oriented Programming) Questions:


- Implement object-oriented concepts, classes, and objects in C.

DBMS (Database Management System):


- Work with databases, perform CRUD operations (Create, Read, Update,
Delete), and write SQL queries.

SQL (Structured Query Language):


- Write SQL queries for various database operations, including SELECT,
INSERT, UPDATE, and DELETE.
C Programming:
- Solve various C programming problems and tasks related to data types,
control structures, functions, and more.

Python Programming:
- Solve Python programming problems and tasks, including data structures
and algorithms.

82.DSA (Data Structures and Algorithms) Theory:


- Learn and understand key concepts, data structures (e.g., arrays, linked
lists, trees), and algorithms (e.g., sorting, searching).

You might also like