1 - C# FundamentalsLanguage - Exercises
1 - C# FundamentalsLanguage - Exercises
-1 + 4 * 6
( 35+ 5 ) % 7
14 + -4 * 6 / 11
2 + 15 / 6 * 1 - 7 % 2
Expected Output:
23
5
12
3
Test Data:
Input the first number: 25
Input the second number: 4
Expected Output:
25 + 4 = 29
25 - 4 = 21
25 x 4 = 100
25 / 4 = 6
25 mod 4 = 1
4. Write a C# Sharp program that takes four numbers as input to calculate and
print the average. Go to the editor
Test Data:
Enter the First number: 10
Enter the Second number: 15
Enter the third number: 20
Enter the four number: 30
Expected Output:
The average of 10 , 15 , 20 , 30 is: 18
Test Data :
Input a number: 12345
Expected Output :
The number in reverse order is : 54321
Test Data :
Input the number of elements to store in the array :3
Input 3 number of elements in the array :
element - 0 : 2
element - 1 : 5
element - 2 : 7
Expected Output:
The values store into the array are:
2 5 7
The values store into the array in reverse are :
7 5 2
Expected Output:
The Even elements are:
42 56 32
The Odd elements are :
25 47
8. Write a program in C# Sharp to insert New value in the array (unsorted list).
Test Data :
Input the size of array : 4
Input 4 elements in the array in ascending order:
element - 0 : 1
element - 1 : 8
element - 2 : 7
element - 3 : 10
Input the value to be inserted : 5
Input the Position, where the value to be inserted :2
Expected Output :
The current list of the array :
1 8 7 10
After Insert the element the new list is :
1 5 8 7 10
9. Write a C# program remove specified a character from a non-empty string
using index of a character.
Test Data:
Fpt@university
Sample Output:
pt@university
Fptuniversity
Fpt@universit
10.Write a C# program to create a new string from a given string where the
first and last characters will change their positions
Test Data:
w3resource
Python
Sample Output:
e3resourcw
nythoP
Test Data: Write a C# Sharp Program to display the following pattern using
the alphabet.
Sample Output:
following
Sample Output:
Original String: Display the pattern like pyramid using the alphabet.
Reverse String: alphabet. the using pyramid like pattern the Display