SOOPRO Pathshala provides C# Exercises
SOOPRO Pathshala Exercises
1. Write a program to print your full name.
2. Write a program to print an integer entered by the user.
3. Write a program to print the sum of 23 and 43.
4. Write a program to print average of two integer(taking input from user).
5. Write a program to print sum of three float numbers and its average.(Taking numbers from user).
6. Write a program to find average of four long numbers.
7. Write a program to find sum of three double number.
8. Write a program to multiply two flaoting-point numbers.
9. Write a program to convert inches to yard, feet and centimeter(taking values of inches from user).
10. Write a program to convert Kilometer per hour to Miles per hour.(Taking input as 25kmph).
11. Write a program to calculate compound interest and simple interest(Taking p,r,t from user).
12. Write a program to find square and square root of 7 and 14.(Using float data type for square root).
13. Write a program to find area of square whose diagonal is 6√2.
14. Write a program to find area and cicumference of circle.(Taking r=7.36)
15. Write a program to find the area and perimeter of rectangle.(Taking value of l and b from user.)
16. Write a program to calculate the volume of sphere.(Input the radius of sphere is 6).
17. Write a program to calculate the volume of cube.(Input the size of cube is 5).
18. Write a program to calculate the volume of cylinder.(Input radius and height is 6 and 8).
19. Write a program to find area any triangle using Heron's Formula.(Taking the lengths of triangle from user).
20. Write a program to find the third angle of triangle.(Input two angles are 85 and 63 degree).
21. Write a program to compute the specified expressions and print the output. Expression : (25.5*3.5-3.5*3.5)/(40.5-4.5) [Answer : 2.13889]
22. Write a program to find distance travelled by a motorbike when its runs on 90kmph for 2.3 hr.
23. Write a program to convert Celsius to Farenheit.(Taking input C=35)
24. Write a program to convert Kelvin to Farenheit.(Taking input K=300)
25. Write a program to convert Celsius to Kelvin.(Taking input C=0)
SOOPRO Pathshala Exercises
1. Write a program that reads a number in inches and converts it to meters.
2.Write a program to convert minutes into years and days.
3.Write a program that prints the current time in GMT.
4.Write a program to accept and display your name.
5. Write a program to accept and display salary in float.
6.Write a program to accept and display your id.
7.Write a program that takes two integer numbers and print sum of numbers.
8.Write a program that takes three float numbers and print sum of numbers.
9.Write a program to print square of any number.
10.Write a program to print cube of any numbrer.
11.Write a program that reads a number and displays the square, cube, and fourth power.
12.Write a program that accepts two integers from the user and prints the sum, the difference, the product, the average, the division and the remainder.
13.Write a program to concatenate first and last name by user input.
14.Write a program to print sum of one float and one integer number.
15.Write a program to print sum of one long and one double number.
SOOPRO Pathshala Exercises
1. Write a program to find maximum between two numbers using conditional operator.
2. Write a program to find maximum between three numbers using conditional operator.
3. Write a program to check whether a number is even or odd using conditional operator.
4. Write a program to check whether a number is even or odd using conditional operator.
5. Write a program to check whether year is leap year or not using conditional operator.
6. Write a program to check whether character is an alphabet or not using conditional operator.
7. Program to Check Whether a Character is Vowel or Consonant using Conditional operator
8. Program to Check Character is Alphabet, Digit or Special Character using Conditional operator
9. program to check whether a character is Uppercase or Lowercase using Conditional operator
10. Program to find smallest among three numbers using Conditional operator
11. Program to check whether the given integer is positive,negative or zero using Conditional operator
12. Program to print largest of two numbers using conditional operator
13. Program to print smallest of two numbers using conditional operator
14. Program to print largest of three numbers using conditional operator
15. Program to print smallest of three numbers using conditional operator
16. Program to print enter number is even number or odd number using conditional operator
17. Program to print check leap year or common year using Conditional operator
18. Program to check alphabet or no alphabet using conditional operator
19. Program to check alphabet or no alphabet using ASCII value and conditional operator
20. Program to check vowel or consonant using conditional operator
21. Program to check vowel or consonant using ASCII value and conditional operator
22. Program to check alphabet, digit or special symbal using conditional operator
23. Program to check alphabet, digit or special symbal using ASCII value and conditional operator
24. Program to check enter alphabet is upper case or lower case using conditional operator
25. Program to check enter alphabet is upper case or lower case using ASCII value and conditional operator
26. Program to check the given integer is positive,negative or zero using and conditional operator
27. Program to check enter week number and print day of week using conditional operator
28. Program to check print number of days in month using conditional operator
29. Program to check print number of days in month using or operator and conditional operator
30. Program to check print number of days in month and month name using conditional operator
31. Program to check print check triangle validity when angles are given using conditional operator.
32. Program to check valid triangle when sides are given using logical AND operator and conditional operator
33. Program to check isosceles,scalene or equilateral triangle when sides are given using conditional operator
34. Program to check calculate profit or loss using conditional operator
35. Program to enter student marks and find percentage and grade using conditional operator
36. Write a program to add 8 to the number 2345 and then divide it by 3. Now, the modulus of the quotient is taken with 5 and then multiply the resultant value by 5. Display the final result.
37. Write a program to check if the two numbers 24 and 45 are equal.
38. Write a program to print the power of 7 raised to 5.
39. The total number of students in a class are 90 out of which 45 are boys. If 50% of the total students secured grade 'A' out of which 20 are boys, then write a program to calculate the total number of girls getting grade 'A'.
40. Write a program to calculate the sum of the digits of a 3-digit number.
41. Write a program to reverse a 3-digit number
42. Check if the string "apple" is equal to the string "banana" using the equality operator. Print the result.
SOOPRO Pathshala Exercises
1. Write a program to get a number from the user and print whether it is positive or negative.
2. Write a program that takes three numbers from the user and prints the greatest number.
3. Write a program that takes a number from the user and generates an integer between 1 and 7. It displays the weekday name.
4. Write a program that reads two floating-point numbers and tests whether they are the same up to three decimal places.
5. Write a program to find the number of days in a month.
6. Write a program that takes a year from the user and prints whether it is a leap year or not.
7. Write a program to check even or odd number.
8. Write a program to print valid to vote if age greater than or equal to 18 else print not valid to vote.
9. Write a program to print maximum among two integer numbers.
10. Write a program to print square of maximum and cube of minimum number.
11. Write a program to print diff of max and min among three numbers.
12. Write a program to print grade of student marks.
13. Write a program to print both are equal no, if two numbers are equal else print not equal.
14. Write a program to print 1 if two integer numbers are same, else print 0.
15. Write a program to print smallest among three numbers.
16. Write a program to print addition of two numbers on choice 1, subtraction of two numbers on choice 2, multiplication of two numbers on choice3 and division of two numbers on choice 4.
17. Write a program to print area of circle on choice 1, area of rectangle on choice 2, area of traingle on choice 3, invalid choice on choice 4.
18. Write a program to print sum of square and cube of any even number.
19. Write a program to print diff of square and cube of any odd number.
20. Write a program to print product of square and cube of even number
SOOPRO Pathshala Exercises
1. Write a program to print 1 to 10 using for loop.
2. Write a program to print 10 to 1 using for loop.
3. Write a program to print 20 to 50 using for loop.
4. Write a program to print sum of 1 to 10 using for loop.
5. Write a program to print square of 1 to 10 using for loop.
6. Write a program to print cube of 1 to 10 using for loop.
7. Write a program to print even sum and odd sum of 1 to 10.
8. write a program to print table of any number using for loop.
9. Write a program to calculate the sum of first 10 natural number.
10. Write a program that prompts the user to input a positive integer. It should then print the multiplication table of that number.
11. Write a program to find the factorial value of any number entered through the keyboard.
12. Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another.
13. Write a program that prompts the user to input an integer and then outputs the number with the digits reversed. For example, if the input is 12345, the output should be 54321.
14. Write a program that reads a set of integers, and then prints the sum of the even and odd integers.
15. Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is a prime number.
16. Write a program to calculate HCF of Two given number.
17. Write a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate.
18. Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.
19. Write a program to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered.
20. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number.
21. Write a program to print Fibonacci series of n terms where n is input by user :
22. Write a program to calculate the sum of following series where n is input by user. 1 + 1/2 + 1/3 + 1/4 + 1/5 +…………1/n
23. Write a program to print prime numbers between 2 to 50.
24. Write a program to print not prime numbers between 2 to 10.
25. Write a program to print your name ten times using while loop.
26. Write a program to print vowels and consonants of your first name.
27. Write a program to print vowels in left side and consonants in right side.
28. Write a program to print square of all odd numbers of 1 to 10.
29. Write a program to print cube of all even numbers of 1 to 10.
30. Write a program to print average of 1 to 10.
31. Write a program to print sum of table of any number.
32. Write a program to print sum of table of 1 to 5.
33. Write a program to print table of only even numbers between 5 to 20.
34. Write a program to print table of only odd numbers between 2 to 20.
35. Write a program to print total table sum between 1 to 10.
36. Write a program to print all even numbers between 2 to 50 in left side and all odd numbers in right side.
37. Write a program to print reverse of any three digit numbers.
38. Write a program to print sum of first and last number of any four digit numbers.
39. Write a program to print subtract of first and last number of any five digit numbers.
40. Write a program to print product of max and min of any four digit numbers.
41. Write a program to check whether given number is palindrome or not.
42. Write a program to check armstrong number.
43. Write a program to print table of max of and factorial of min of any five digit numbers.
44. Write a program to print sum of max and min and average of all three digit numbers.
45. Write a program to print following :
*
**
***
****
*****
46. Write a program to print table of any number in horizontal form.
47. Write a program to print square of all odd numbers in vertical form
48. Write a program to print factorial of 1 to 5.
49. Write a program to print factorial sum of all odd numbers between 1 to 10.
50. Write a program to print prime sum of odd even numbers between 5 to 50.
SOOPRO Pathshala Exercises
1. Create a single dimensional array.
2. Write a program to create single dimensional array and store values in it using user input.
3. Write a program to create single dimensional array of int type.
4. Write a program to create single dimensional array of char type.
5. Write a program to create float array of single dimensional array.
6. Write a program to create single dimensional array of double type.
7. Write a program to create single dimensional array of long type.
8. Write a program to create single dimensional array of string type.
9. Write a program to print sum of all elements of int array.
10. Write a program to print sum of all elements of long array.
11. Write a program to print sum of all elements of float array.
12. Write a program to print sum of all elements of float array.
13. Write a program to print even and odd of integer array.
14. Write a program to print square of integer array.
15. Write a program to print square of float array.
16. Write a program to print square of double array.
17. Write a program to print square of long array.
18. Write a program to print evensum and oddsum of int array.
19. Write a program to print square of even number and cube of odd number of array.
20. Write a program to print average of array.
21. Write a program to print sum and average of only even numbres in array.
22. Write a program to print multiplication of odd numbers of single dimensional array.
23. Write a program to print maximum of array.
24. Write a program to print sum and multiplication of odd numbers of single dimensional array.
25. Write a program to print minimum of array.
26. Write a program to print maximum and minimum of single dimensional array.
27. Write a program to print 2nd maximum number of array.
28. Write a program to print 2nd minimum number of array.
29. Write a program to print square of maximum of single dimensional array.
30. Write a program to print cube of minimum of single dimensional array.
31. Write a program to copy integer array.
32. Write a program to copy string array.
33. Write a program to copy float array.
34. Write a program to copy long array.
35. Write a program to print sum and average of only odd numbers of array.
36. Write a program to pass integer array to function.
37. Write a program to pass float array to function.
38. Write a program to pass long array to function.
39. Write a program to print sum of long array.
40. Write a program to return total sum of avg and sum of single dimensional array.
41. Write a program to return maximum of array.
42. Write a program to return minimum of array.
43. Write a program to return diff of maximum and minimum of array.
44. Write a program to return avg of even numbers of array.
45. Write a program to return sum of odd numbers of array.
46. Write a program to check prime and not prime of array.
47. Write a program to print primesum and not prime sum of array.
48. Write a program to return array.
49. Write a program to pass and return integer array.
50. Write a program to pass and return float array.
51. Write a program to pass and return double array.
52. Write a program to pass and return char array.
53. Write a program to pass and return long array.
54. Write a program to print reverse of string array.
55. Write a program to print sum of first value and last value of array.
56. Write a program to print factorial of array.
57. Write a program to print factorial of max and min of array.
58. Write a program to print factorial of diff of max and min of array.
59. Write a program to print table of array.
60. Write a program to print table sum of array.
61. Write a program to print table sum of array.
62. Write a program to create multi dimensional array.
63. Write a program to print first row of multi dimensional array.
64. Write a program to print second row of multi dimensional array.
65. Write a program to print third row of multi dimensional array.
66. Write a program to print table of first row of multi dimensional array.
67. Write a program to print table of last column of multi dimensional array.
68. Write a program to pass multi dimensional array to method.
69. write a program to pass and return matrix.
70. Write a program to pass string matrix and print second row of matrix.
71. Write a program to pass char matrix and print second column of matrix.
72. Write a program to pass float matrix and return avg of third row of matrix.
73. Write a program to print array elements in ascending order
74. Write a program to print array elements in descending order.
75. Write a program to print square of second maximum and cube of third minimum of single d array.
SOOPRO Pathshala Exercises
1. Write a program to show the simple structure of a function.
2. Write a program to find the square of any number using the function.
3. Write a program to swap two numbers using a function.
4. Write a program to check if a given number is even or odd using the function.
5. Write a program to check whether a number is a prime number or not using the function.
6. Write a program to get the largest element of an array using the function.
7. Write a program to check Armstrong and Perfect numbers using the function.
8. Write a program to print table of any number using function.
9. Write a program to print sum of any table using function.
10. Write a program to compare string value using function.
11. Write a program to find the maximum and minimum of some values using a function that returns an array.
12. Write a program to print the square of array elements using callback function.
13. Write a program to find cube of any number using function.
14. Write a program to find diameter, circumference and area of circle using functions
15. Write a program to find maximum and minimum between two numbers using functions.
16. Write a program to check whether a number is even or odd using functions.
17. Write a program to check whether a number is prime, Armstrong or perfect number using functions.
18. Write a program to find all prime numbers between given interval using functions.
19. Write a program to print all strong numbers between given interval using functions.
20. Write a program to print all Armstrong numbers between given interval using functions.
21. Write a program to print all perfect numbers between given interval using functions.
22. Write a program to find power of any number using recursion.
23. Write a program to print all natural numbers between 1 to n using recursion.
24. Write a program to print all even or odd numbers in given range using recursion.
25. Write a program to find sum of all natural numbers between 1 to n using recursion.
26. Write a program to find sum of all even or odd numbers in given range using recursion.
27. Write a program to find reverse of any number using recursion.
28. Write a program to check whether a number is palindrome or not using recursion.
29. Write a program to find sum of digits of a given number using recursion.
30. Write a program to find factorial of any number using recursion.
31. Write a program to generate nth Fibonacci term using recursion.
32. Write a program to find GCD (HCF) of two numbers using recursion.
33. Write a program to find LCM of two numbers using recursion.
34. Write a program to display all array elements using recursion.
35. Write a program to find sum of elements of array using recursion.
SOOPRO Pathshala Exercises
1. Write a C# program to create a class called "Customer" with a name and age fields. Create two instances of the "Customer" class, set their fields using the constructor, and print their name and age.
2. Write a C# program to create a class called "Rectangle" with width and height fields, set their fields using the constructor and Calculate the area and perimeter of the rectangle.
3. Write a C# program to create a class called "Employee" with a name, salary, and hire date attributes, set their attributes using the constructor and a method to calculate years of service.
4. Write a C# program to create a class called "Book" with attributes for title, author, and ISBN, set their attributes using the constructor, and print their title,author and ISBN.
5. Write a C# program to create a class called "Circle" with radius attribute. Calculate the area, circumference and diameter of the circle using constructor.
6. Write a C# program to create a class called "Student" with a name, grade, and courses attributes,set their attributes with constructor and methods to display all the information of student.
7. Write a C# program to create a class called "School" with attributes for students, teachers, and classes, set their attributes using the constructor and methods to display information of school.
8. Create a private constructor of name Person, having id,name,gender,dob and address fields.
9. Write a c# program to add two integer numbers, two float numbers, try to solve this assignment using constructor overload.
10. Write a c# program to create a class called "Shape", try to print area of rectangle, area of circle using static constructor.
11. Write a program to return prime sum of array using parameterized constructor.
12. Write a progaram to return not prime sum of array using parameterized constructor.
13. Write a program to return factorial sum of array using parameterized constructor.
14. Write a program to return sum of even elements of array using parameterized constructor.
SOOPRO Pathshala Exercises
1. write a program to return sum of even numbers of any four digit number to child class of same application.
2. Write a program to return product of odd number of any five digit number to child class of same application.
3. Write a program to implement multilevel inheritance.
4. Write a program to return sum of prime number of any given 5 digit number to grand child.
5. Write a program to return cube of max of any three digits number to grand child.
6. Write a program to perorm multiple inheritance.
7. Write a program to return sum of all alternative numbers of 6 digits of any nymber to many child.
8. Write a program to reverse and return your first name to grand child.
9. Write a program to reverse and return any integer digits to multiple child classes.
10. Write a program to return concatenation of first and last letter of any string to child class.
11. Write a program to return reverse of integer array to grand child of different application.
12. Write a program to return reverse of float array to child of different application.
SOOPRO Pathshala Exercises
1. Write a program to perform method overloading.
2. Write a program to override virtual method that print simple interest.
3. Write a program to override virtual method that print difference of largest and smallest value of array.
4. Write a program to override abstract method that print area of rectangle and perimeter of rectangle.
5. Write a program to overload print method that print area of rectangle, area of triangle and area of circle
6. Write a c# program to create an interface shape with the getArea() method. Create three classes Rectangle,Circle, and Triangle that implement the shape interface.Implement the getArea() method for each of the three classes.
7. Write a C# program to create a Animal interface with a method called bark() that takes no arguments and returns void. Create a Dog class that implements Animal and overrides bark() to print "Dog is barking".
8. Write a C# programming to create a banking system with four classes - Bank, Account, SavingsAccount, and CurrentAccount. The bank should have a list of accounts and methods for adding them. Accounts should be an interface with methods to deposit, withdraw, calculate interest, and view balances. SavingsAccount and CurrentAccount should implement the Account interface and have their own unique methods.
SOOPRO Pathshala Exercises
1. Write a program to print area of triangle using encapsulation.
2. Write a program to print reverse of any string using abstraction.
3. Write a program to create an interface Resizable with method resizewidth(int width) and resizeHeight(int height) that allow an object to be resized. Create a class rectangle that implement the Resizable interface and implements the resize method.
4. Write a c# program to create an abstract class Shape with abstract methods calculateArea() and calculatePerimeter(). Create subclasses Circle and Triangle that extend the Shape class and implement the respective methods to calculate the area and perimeter of each shape.
5. Write a c# program to create an abstract class BankAccount with abstract methods deposit() and withdraw(). Create subclasses: SavingsAccount and CurrentAccount that extend the BankAccount class and implement the respective methods to handle deposits and withdrawals for each account type.
6. Write a c# program to create an abstract class Animal with abstract methods eat() and sleep(). Create subclasses Lion, Tiger, and Deer that extend the Animal class and implement the eat() and sleep() methods differently based on their specific behavior.
SOOPRO Pathshala Exercises
1. Write a program to print area,diameter and circumference of circle using multi cast delegate.
2. Write a program to print area and perimeter of rectangle using multi cast delegate.
3. Write a program to print area and perimeter of triangle using multi cast delegate.
4. Try to perform arithmetic operation using muticast delegate,make sure that all methods of arithmetic that should be declared in different package.
5. Write a program to print vowels of your first name,reverse of your first name and total length of your first name using multi cast delegate.
SOOPRO Pathshala Exercises
1. Write a program to generate and handle divide by zero exception.
2. Write a program to perform index out of range on string array.
3. Write a program to store string value into integer variable.
4. Write a program to create user define exception zeroagefound.
5. Write a program to define multiple catch block for indexoutofbound exception.
6. Write a program to define nested try block.
7. Write a C# program to implement a method that takes an integer as input and throws an exception if the number is negative. Handle the exception in the calling code.
8. Write a C# program that prompts the user to input a numeric integer and throws an exception if the number is less than 0 or greater than 1000.
9. Write a C# program that implements a method that takes an array of integers as input and calculates the average value. Handle the exception if the array is empty.
10. Write a C# program that reads a string from the user and converts it to an integer. Handle the exception if the input cannot be parsed into an integer.
11. Write a C# program that creates a method that takes a string as input and converts it to uppercase. Handle the NullReferenceException that occurs if the input string is null.
12. Write a C# program that reads a number from the user and calculates its square root. Handle the exception if the number is negative.
13. Write a program to handle null pointer exception.
14. Write a program to handle dividebyzero exception in different class of same application.
15. Write a program to handle formatexception in different class of different application.
16. Write a program to handle indexoutofrange in child class of same application.
17. Write a program to create a method that takes a string as input and throw an exception if the string does not contains vowels.
SOOPRO Pathshala Exercises
1. Write a program to create a file.
2. Write a program to write into a file.
3. Write a program to read from a file.
4. Write a program to truncate/delete data from file.
5. Write a program to delete a file.
6. Write a program to create a folder.
7. Write a program to create a sub-folder.
8. Write a program to write a file into sub-folder.
9. Write a program to delete specific data from file.
10. Write a program to appending file.
11. Write a program to move file from one place to another place.
12. Create file on choice 1, write into file on choice 2, read from file on choice 3, truncate file on choice 4, delete file on choice 5.
13. Write a program to create folder.
14. Write a program to create sub-folder.
15. Write a program to create text file.
SOOPRO Pathshala Exercises
1. Write a program to add elements in non generic using arraylist on choice 1, display data on choice 2, add new element on choice 3, and remove element value wise on choice 4 display new list on choice 5
2. Write a program to add elements in non generic using stack on choice 1, remove element on choice 2, display new stack on choice 3.
3. Write a program to add elements in non generic using queue on choice1, remove element from queue on choice 2, display elements of queue on choice 3.
4. Write a program to write elements of queue into word file.
5. Write a program to write elements of list into text file.
6. Write a program to write elements of stack into word file.
SOOPRO Pathshala Exercises
1. Write a c# program to store different types of data in structure and print it.
2. Write a c# program to pass structure to method having bookid,bookname and bookprice.
3. Write a c# program to create and pass structure to method in c#.
SOOPRO Pathshala Exercises
1. Create window application to perform standard arithmetic operation.
2. Create window application for unit measurement.
3. Print maximum of four integer using GUI
4. Print concatenation of first and last name using GUI.
5. Create unit converter in window application.
6. Try to bind generic string list of fruits with combobox and print selected item on label in window application.
7. Try to bind generic int list of student marks with combobox and print selected marks on label in window application.
8. Create details form having Title,Name,Gender,Email,Mobile,Technology,Address,City and State. try to print details on label control.
9. Try to bind your favorite food with comboBox using list.
10. Try to bind your favorite colors with comboBox using list.
11. Create simple login form for user and admin both, take two radio button for validating user and admin, print message on successful login.
12. Try to change background color of form on selected color from combobox.
13. Try to change for color of textbox on selected color from combobox.
14. Create details form with crud operation using GUI
15. Create sample login form in window application
16. Create employee registration form in windows application, try to save records in database on submit button click, and view all emolyees on view button click.
17. Create menu driven program in window application, on choice 1 print what is sql, on choice 2 print what is table, on choice 3 print what is row and on choice 4 print what is column.