Exercises: Simple Calculations

Let's strengthen the knowledge gained throughout this chapter with a few more exercises.

Video: Chapter Summary

Watch the following video to summarize what we learned in this chapter: https://youtu.be/Zv_c-M_7Gyw.

What We Learned in This Chapter?

Let's summarize what we learned in this chapter:

  • Reading a text: var str = Console.ReadLine();
  • Reading an integer: var num = int.Parse(Console.ReadLine());
  • Reading a floating-point number: var num = double.Parse(Console.ReadLine());
  • Calculations with numbers and using the suitable arithmetic operators [+, -, *, /, ()]: var sum = 5 + 3;
  • Printing a text by placeholders on the console: Console.WriteLine("{0} + {1} = {2}", 3, 5, 3 + 5);

The Exercises

We have a lot of practical work. Solve these exercises to learn how to work with variables and data types, reading and writing on the console, using data and calculations:

results matching ""

    No results matching ""