help With this

Yassorarab

New member
Joined
Jun 7, 2023
Messages
2
Programming Experience
Beginner
hello every one i want to know the right answer for this is that 51 or 50 and thanks for help ...
 

Attachments

  • 351345720_111973148584949_786906819102609604_n.jpg
    351345720_111973148584949_786906819102609604_n.jpg
    52.9 KB · Views: 11
This thread needs improvement on a number of fronts.
  1. The title should be a summary description of the problem. This title is as much use as no title at all, given that everyone who posts wants help. If you can't summarise the problem in the title then you don't understand your problem well rough to be posting yet at all.
  2. The post should contain a full and clear description of the problem. This post contains basically no description at all.
  3. Code, error messages and the like should be posted as text, formatted appropriately. We can't copy text from a picture to test code, search for error messages, etc.
  4. You shouldn't need to ask us things that you can test for yourself. Run the code and see what the value is and you have your answer. I would definitely encourage you to use this site for things that you can't work out for yourself but this does not fall in that category. If you wanted to know why the value is what it is or the like then that's something that we could help with.
 
Also, that question looks to be from a C/C++ quiz or assignment (or interview question). Although it's valid C#, it's not written in the C# style. The (recommended) C# style would have empty curly braces as the body of the loop (on the following lines), instead of just a naked semicolon trailing the for loop header.
 
OK so let's think about this

When the condition is true the loop runs
When the condition is false the loop does not run
Z ticks up by one each time
What is the first possible value of Z that causes the condition to be false?
 
OK so let's think about this

When the condition is true the loop runs
When the condition is false the loop does not run
Z ticks up by one each time
What is the first possible value of Z that causes the condition to be false?

when Z = 51
 
Back
Top Bottom