0% found this document useful (0 votes)
24 views

Logic Building Questions

Uploaded by

Prasad Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Logic Building Questions

Uploaded by

Prasad Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Logic Building Questions

Arrays

- Write a program to find the second largest number in an array.

- Reverse an array without using an additional array.

- Rotate an array to the left by a given number of positions.

- Count the occurrences of each element in an array.

- Check if two arrays are permutations of each other.

- Merge two sorted arrays into one sorted array.

- Find the subarray with the maximum sum (Kadane?s Algorithm).

Strings

- Check if a string is a palindrome.

- Reverse each word in a string without changing the word order.

- Count vowels and consonants in a string.

- Find the first non-repeating character in a string.

- Remove all duplicate characters from a string.

- Check if two strings are anagrams of each other.

- Implement a function to compress a string (e.g., 'aaabb' -> 'a3b2').


Logic Building Questions

Functions

- Write a function to calculate the factorial of a number.

- Create a function to check if a number is prime.

- Implement a function to generate Fibonacci numbers up to `n`.

- Write a function to calculate the power of a number using recursion.

- Implement a function to find the GCD (Greatest Common Divisor) of two numbers.

- Write a function to convert a decimal number to binary.

- Implement a function to find all permutations of a given string.

Object-Oriented Programming (OOPs)

- Create a class `BankAccount` with methods to deposit, withdraw, and check balance.

- Implement a `Rectangle` class with methods to calculate area and perimeter.

- Design a `Person` class with properties for name, age, and a method to display the details.

- Create a `Shape` base class and derive classes for `Circle`, `Square`, and `Rectangle`.

- Demonstrate method overloading and overriding using a `Calculator` class.

- Design an abstract class `Vehicle` with a method `StartEngine` and derive classes for `Car` and

`Bike`.

- Implement a `Student` class with properties, constructors, and methods for managing student data.
Logic Building Questions

C#

- Write a program to demonstrate `foreach` with a collection.

- Implement a generic method to swap two variables.

- Use LINQ to find the largest and smallest numbers in a list.

- Write a program to handle exceptions for division by zero.

- Create an interface `IShape` with methods for area and perimeter, and implement it in `Circle` and

`Rectangle`.

- Write a program to demonstrate the use of `async` and `await`.

- Create a collection of employees and sort them by their salaries.

WinForms

- Create a login form with validation for username and password.

- Design a form to add, edit, and delete items in a list.

- Create a form with a `DataGridView` to display and edit product details.

- Develop a form to calculate the sum of two numbers using text boxes and a button.

- Implement a form with a timer to display the current time.

- Create a notepad application with options to save, open, and edit text files.

- Design a simple calculator application with basic arithmetic operations.

You might also like