Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace DemoProject
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- //събиране -> +
- //int + int = int
- //int + double = double
- //double + int = double
- //double + double = double
- //изваждане -> -
- //int - int = int
- //int - double = double
- //double - int = double
- //double - double = double
- //умножение -> *
- //int * int = int
- //double * int = double
- //int * double = double
- //double * double = double
- //деление -> /
- //int / int = int
- Console.WriteLine(5 / 2); //2
- //int / double = double
- Console.WriteLine(5 / 2.0); //2.5
- //double / int = double
- Console.WriteLine(5.0 / 2); //2.5
- //double / double = double
- Console.WriteLine(10.2 / 2.1); // 5
- //int -> double
- //5 * 1.0 -> 5.0
- //double -> int !!!!!
- //5.6 -> 5
- //деление с остатък -> %
- Console.WriteLine(10 % 3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement