Answer the question
In order to leave comments, you need to log in
What will the code from Pascal to C# look like?
How would this piece of Pascal code look like in C#?
a := x div 100;
b := x (div 10) mod 10;
c := x mod 10
Answer the question
In order to leave comments, you need to log in
In C#
int x = 123;
//Целая часть при делении, то есть ответ будет 1
int a = x / 100;
Console.WriteLine(a);//1
//В скобках берем целую часть, то есть 12 и от 12 получаем остаток, то есть 2
int b = (x / 10) % 10;
Console.WriteLine(b);//2
//Остаток от деления, то есть 3
int c = x % 10;
Console.WriteLine(c);//3
Console.ReadKey();
double a = x / 100;
double b = (x / 10) % 10;
double c = x % 10;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question