Click here to Skip to main content
15,898,374 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why does Navigation throw null exception when returning to a page 2nd time Pin
NeillJam15-Oct-15 20:20
NeillJam15-Oct-15 20:20 
Questionis this the Best method to get prime numbers between a range Pin
Sujith Karivelil13-Oct-15 18:54
professionalSujith Karivelil13-Oct-15 18:54 
AnswerRe: is this the Best method to get prime numbers between a range Pin
OriginalGriff13-Oct-15 20:12
mveOriginalGriff13-Oct-15 20:12 
GeneralRe: is this the Best method to get prime numbers between a range Pin
Sujith Karivelil13-Oct-15 20:57
professionalSujith Karivelil13-Oct-15 20:57 
QuestionC# desktop app being shared Pin
classy_dog13-Oct-15 7:15
classy_dog13-Oct-15 7:15 
AnswerRe: C# desktop app being shared Pin
Richard MacCutchan13-Oct-15 8:00
mveRichard MacCutchan13-Oct-15 8:00 
SuggestionRe: C# desktop app being shared Pin
Richard MacCutchan13-Oct-15 8:06
mveRichard MacCutchan13-Oct-15 8:06 
QuestionC# Program Output?? Pin
Member 1205574913-Oct-15 5:49
Member 1205574913-Oct-15 5:49 
C#
class Program
{
    static void Main(string[] args)
    {
        if (args.Length > 0)
        {
            var v = File.ReadLines("dictionary.txt");

            var v1 = args[2];

            var v2 = args[3];

            var first = v.Where(w => w == v1).First();

            var last = v.Where(w => w == v2).First();

            var l = Array.IndexOf(v.ToArray(), first);

            var l2 = Array.IndexOf(v.ToArray(), last);

            var l3 = l2 - l;

            var results = v.Skip(l).Take(l3);

            foreach (var result in results)
            {
                Console.WriteLine(result);
            }
        }
        else
        {
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("Arguments invalid");
        }
    }
}

// Please provide written answers to the questions below.
// 1. What is this code doing?
// 2. Comment on the quality of this code / how could you improve this implementation?
// 3. How could you verify the behaviour is correct?

AnswerRe: C# Program Output?? Pin
Eddy Vluggen13-Oct-15 6:04
professionalEddy Vluggen13-Oct-15 6:04 
GeneralRe: C# Program Output?? Pin
Rob Philpott13-Oct-15 6:45
Rob Philpott13-Oct-15 6:45 
GeneralRe: C# Program Output?? Pin
Eddy Vluggen13-Oct-15 8:36
professionalEddy Vluggen13-Oct-15 8:36 
AnswerRe: C# Program Output?? Pin
Nelson Costa Inácio13-Oct-15 6:53
Nelson Costa Inácio13-Oct-15 6:53 
AnswerRe: C# Program Output?? Pin
Pete O'Hanlon13-Oct-15 7:02
mvePete O'Hanlon13-Oct-15 7:02 
QuestionRe: C# Program Output?? PinPopular
Paul Conrad13-Oct-15 7:13
professionalPaul Conrad13-Oct-15 7:13 
AnswerRe: C# Program Output?? Pin
John Torjo19-Oct-15 22:09
professionalJohn Torjo19-Oct-15 22:09 
Questionc Pin
User 1202214013-Oct-15 5:12
User 1202214013-Oct-15 5:12 
QuestionRe: c# Pin
Paul Conrad13-Oct-15 5:19
professionalPaul Conrad13-Oct-15 5:19 
AnswerRe: c Pin
Richard MacCutchan13-Oct-15 7:56
mveRichard MacCutchan13-Oct-15 7:56 
Questionre-cast of Control back to its Native Type ? Pin
BillWoodruff13-Oct-15 0:48
professionalBillWoodruff13-Oct-15 0:48 
AnswerRe: re-cast of Control back to its Native Type ? Pin
Pete O'Hanlon13-Oct-15 1:14
mvePete O'Hanlon13-Oct-15 1:14 
GeneralRe: re-cast of Control back to its Native Type ? Pin
BillWoodruff13-Oct-15 2:06
professionalBillWoodruff13-Oct-15 2:06 
GeneralRe: re-cast of Control back to its Native Type ? Pin
Pete O'Hanlon13-Oct-15 2:21
mvePete O'Hanlon13-Oct-15 2:21 
GeneralRe: re-cast of Control back to its Native Type ? Pin
BillWoodruff13-Oct-15 3:01
professionalBillWoodruff13-Oct-15 3:01 
AnswerRe: re-cast of Control back to its Native Type ? Pin
Eddy Vluggen13-Oct-15 1:42
professionalEddy Vluggen13-Oct-15 1:42 
GeneralRe: re-cast of Control back to its Native Type ? Pin
BillWoodruff13-Oct-15 2:18
professionalBillWoodruff13-Oct-15 2:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.