0

What is the output ??

int x = 15; int y = 6; X% = y; Console.writeline(x);

19th Mar 2019, 9:09 AM
Naitry Doshi
Naitry Doshi - avatar
4 Answers
+ 4
..\Playground\(18,4): error CS1525: Invalid expression term '='
19th Mar 2019, 9:28 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 2
Naitry Doshi couple of things to remember when using c# line 3 should be x %= y; line 4 should be Console.WriteLine(x); which eventually produces: https://code.sololearn.com/cQo1f7EMsH3H/?ref=app edit: Assignment & Increment Operators https://www.sololearn.com/learn/CSharp/2590 edit: Naitry Doshi because its remainder https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/remainder-assignment-operator https://www.dotnetperls.com/modulo
19th Mar 2019, 9:41 AM
Daljit Singh
Daljit Singh - avatar
0
Ok Thx... I understand it.
20th Mar 2019, 1:38 PM
Naitry Doshi
Naitry Doshi - avatar
0
1. What is the output of the following code? for (int i = 0; i < 5; i++) { if (i == 2) { continue; } Console.WriteLine(i); }
1st Apr 2023, 12:56 PM
Maxamed Cusmaan
Maxamed Cusmaan - avatar