0

Hello everyone i need help with this task :
"Write an expression that checks for given integer if its third digit (right-to-left) is 7. E. g. 1732 -> true"

Edited by thechampp

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by thechampp
0

Hi,
As a general rule we don't do your homework for you. If you have made a fair attempt at the question, show us how far you got and we'll nudge you in the right direction. For example, for your question, what have you tried or what do you think will be a good solution? Show us you've made some effort and we'll be more likely to help.

0

What have you managed to do so far ? Can you post it in this thread so we can see if you're on the right track and try to help is we can ?

0

i have only this, but the main part (finding the third digit i don't have an idea,thinking about 2 hours) is difficult to find the solution.

Console.WriteLine("enter a number"); 
int number; 
string c; 
c = Console.ReadLine(); 
bool check = int.TryParse(c, out number); 
while (check == false) 
{ 
Console.WriteLine("please enter a valid number"); 
c = Console.ReadLine(); 
check = int.TryParse(c, out number); 
}

Edited by thechampp

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.