Solution of chapter 4 exercises of Svetlin Nakov's book - C# Fundamentals Exercises
-
Write a program that reads from the console three numbers of type int and prints their sum.
-
Write a program that reads from the console the radius "r" of a circle and prints its perimeter and area.
-
A given company has name, address, phone number, fax number, web site and manager. The manager has name, surname and phone number. Write a program that reads information about the company and its manager and then prints it on the console.
-
Write a program that prints three numbers in three virtual columns on the console. Each column should have a width of 10 characters and the numbers should be left aligned. The first number should be an integer in hexadecimal; the second should be fractional positive; and the third – a negative fraction. The last two numbers have to be rounded to the second decimal place.
-
Write a program that reads from the console two integer numbers (int) and prints how many numbers between them exist, such that the remainder of their division by 5 is 0. Example: in the range (14, 25) there are 3 such numbers: 15, 20 and 25.
-
Write a program that reads two numbers from the console and prints the greater of them. Solve the problem without using conditional statements.
-
Write a program that reads five integer numbers and prints their sum. If an invalid number is entered the program should prompt the user to enter another number.
-
Write a program that reads five numbers from the console and prints the greatest of them.
-
Write a program that reads an integer number n from the console. After that reads n numbers from the console and prints their sum.
-
Write a program that reads an integer number n from the console and prints all numbers in the range [1…n], each on a separate line.
-
Write a program that prints on the console the first 100 numbers in the Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, …
-
Write a program that calculates the sum (with precision of 0.001) of the following sequence: 1 + 1/2 - 1/3 + 1/4 - 1/5 + …