Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 1
Defferen logic result
There are two If cycles. When 'y' is equal to 52000. in the first case, the message is Accept, and in the second, an Error. And there must be a mistake everywhere. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { class Print{ private int x; public int Prins{ get{return x;} set { if (x<=50000) {x=value; Console.WriteLine ("Accept"); } else{ Console.WriteLine (" Error");} } } } static void Main(string[] args) { int y=52000; Print p=new Print (); p.Prins =y; int mark = y; if (mark <= 50000) { Console.WriteLine("accept"); } else { Console.WriteLine("error"); } } } }
2 Answers
+ 4
Пётр Попов ,
without having a complete task description we might have to guess what you want to achieve. can you present us the description?
thanks!
0
There are two If cycles. When y= 52000. in the first case, the message is Accept, and in the second, an Error. And there must be "Error"everywhere. Why is this happening. Where is the mistake.