Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace lesson4operators {
- class Program {
- static void Main(string[] args) {
- Console.WriteLine(5);
- Console.WriteLine(+5);
- Console.WriteLine(5 + 5);
- Console.WriteLine(5 + .5);
- Console.WriteLine("5" + "5");
- Console.WriteLine("5" + 5);
- Console.WriteLine("minus section");
- int a = 5;
- Console.WriteLine(a - 1);
- Console.WriteLine(-a);
- Console.WriteLine("wth is negation operator used for?");
- Console.WriteLine("double") //i dont understand double. why cant i use int?
- ; double x = 1.5; //why does it need a semicolon at the beginning?
- Console.WriteLine(x);
- Console.WriteLine(x++);
- Console.WriteLine(x);
- Console.WriteLine(++x);
- Console.WriteLine(x);
- Console.WriteLine("if");
- int b = 2;
- Console.WriteLine(b);
- Console.WriteLine(++b);
- int c = 10;
- int d = 8;
- if (c > 9) {
- if (d > 9) {
- Console.WriteLine("result 1");
- }
- else {
- Console.WriteLine("result 2");
- }
- }
- if (c > 9) {
- if (d > 9) {
- Console.WriteLine("result 1");
- }
- else {
- Console.WriteLine("result 2"); //why don't two 'result 2's appear ?
- }
- }
- Console.WriteLine("totally modulus dood");
- Console.WriteLine(5 % 2);
- Console.WriteLine(5 % 2.2);
- Console.WriteLine(5 % 5);
- //ignore shifts?
- Console.WriteLine(1 is int);
- Console.WriteLine("dog" is int); //these say always and never so im not sure when its supposed to be used
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement