Untitled
unknown
csharp
2 years ago
1.5 kB
6
Indexable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace wstep2
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Witaj, programuje w C#");
Console.WriteLine(2 + 2);
int a = 3; //zmienna a typu całkowitego przechowuje ilosc litrow xx
int b = 4;
Console.WriteLine(a+b);
Console.WriteLine("suma "+ b+ "ora "+a+" wynosi"+(a+b));
Console.WriteLine($"suma {b} oraz {a} wynosi {a + b}");
//tu jest komentarz jednolinijkowy
/*tekst komentarz wielolinijkowy
* teskt
* tkest
*
*/
Console.WriteLine("test");
// typy danych
double c = 4.4; //typ zmiennoprzecinkowy
string imie = "Pawel"; // typ tekstowy łańcuchowy
bool zimno=true; //typ logiczny przyjmuje tylko dwie wartosci true lub false
char plec = 'm'; //typ jednoznakowy
// tworzenie stałych
const int dojrzalosc = 18;
c = c + 1;
Console.WriteLine(c);
//jak zadeklarowac wiele zmiennych na raz
int f = 4, g = 5, h = 6;
// operator przypisania to znak =
f = g = h = 10;
Console.ReadLine();
}
}
}
Editor is loading...