Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using a scripting language in a C# exe Pin
Foothill28-Apr-16 3:31
professionalFoothill28-Apr-16 3:31 
QuestionChart Generating Tool Pin
gopichand.n26-Apr-16 23:45
gopichand.n26-Apr-16 23:45 
QuestionRe: Chart Generating Tool Pin
Richard MacCutchan26-Apr-16 23:57
mveRichard MacCutchan26-Apr-16 23:57 
AnswerRe: Chart Generating Tool Pin
gopichand.n27-Apr-16 1:56
gopichand.n27-Apr-16 1:56 
GeneralRe: Chart Generating Tool Pin
Richard MacCutchan27-Apr-16 2:09
mveRichard MacCutchan27-Apr-16 2:09 
GeneralRe: Chart Generating Tool Pin
gopichand.n3-May-16 1:39
gopichand.n3-May-16 1:39 
GeneralRe: Chart Generating Tool Pin
Richard MacCutchan3-May-16 2:34
mveRichard MacCutchan3-May-16 2:34 
QuestionC# Pin
Member 1248659326-Apr-16 7:45
Member 1248659326-Apr-16 7:45 
I'm stil beginner in c#. and i have made a small program. here is Main Program :
C#
class Program
{
    public static void Main()
    {
        while (true)
        {
            Console.WriteLine("Welcome");
            Console.WriteLine("1 to go to Data class");
            Console.WriteLine("type q to exit");
            string input = Console.ReadLine();
            if (input == "1")
            {
                // What should I type here ????
            }
            else if (input == "q")
            {
                break;
            }
            else
            {
                Console.WriteLine("invalid option");
            }
        }
    }
}

And this One is the Data Class.
C#
class Data
{
    public Data()
    {
        while (true)
        {
            Console.WriteLine("Choose Option : ");
            Console.WriteLine("Press 1 to add and Press 2 To Go to Main Program");
            int entry = int.Parse(Console.ReadLine());
            if (entry == 1)
            {
                Console.WriteLine("Enter any number ");
                int input = int.Parse(Console.ReadLine());
                int result = input += 3;
                Console.WriteLine("result");
                Console.WriteLine(result);
            }
            else if (entry == 2)
            {
            }
            else
            {
                Console.WriteLine("Invalid OPtion");

            }
            break;
        }
    }
}

And I want to do is . When the user type 2 in data class. then the program should go to main program, but unfortunately I dont know how to do that. Anyone Help please
AnswerRe: C# Pin
OriginalGriff26-Apr-16 8:30
mveOriginalGriff26-Apr-16 8:30 
SuggestionRe: C# Pin
Sascha Lefèvre26-Apr-16 9:23
professionalSascha Lefèvre26-Apr-16 9:23 
GeneralRe: C# Pin
Pete O'Hanlon26-Apr-16 9:31
mvePete O'Hanlon26-Apr-16 9:31 
GeneralRe: C# Pin
Matt T Heffron26-Apr-16 10:22
professionalMatt T Heffron26-Apr-16 10:22 
GeneralRe: C# Pin
Pete O'Hanlon26-Apr-16 10:58
mvePete O'Hanlon26-Apr-16 10:58 
GeneralRe: C# Pin
Sascha Lefèvre26-Apr-16 12:01
professionalSascha Lefèvre26-Apr-16 12:01 
SuggestionRe: C# Pin
Richard Deeming27-Apr-16 1:47
mveRichard Deeming27-Apr-16 1:47 
GeneralRe: C# Pin
Sascha Lefèvre27-Apr-16 1:49
professionalSascha Lefèvre27-Apr-16 1:49 
QuestionCapture exceptions and handle those in my custom error handler Pin
Member 1204569226-Apr-16 5:37
Member 1204569226-Apr-16 5:37 
AnswerRe: Capture exceptions and handle those in my custom error handler Pin
Eddy Vluggen26-Apr-16 5:48
professionalEddy Vluggen26-Apr-16 5:48 
QuestionStudent admin management system C# console Pin
Member 1248538426-Apr-16 5:19
Member 1248538426-Apr-16 5:19 
QuestionRe: Student admin management system C# console Pin
Richard MacCutchan26-Apr-16 5:26
mveRichard MacCutchan26-Apr-16 5:26 
AnswerRe: Student admin management system C# console Pin
Eddy Vluggen26-Apr-16 5:55
professionalEddy Vluggen26-Apr-16 5:55 
GeneralRe: Student admin management system C# console Pin
Member 1248538426-Apr-16 7:48
Member 1248538426-Apr-16 7:48 
QuestionRe: Student admin management system C# console Pin
Eddy Vluggen26-Apr-16 8:25
professionalEddy Vluggen26-Apr-16 8:25 
GeneralRe: Student admin management system C# console Pin
Matt T Heffron26-Apr-16 7:54
professionalMatt T Heffron26-Apr-16 7:54 
AnswerRe: Student admin management system C# console Pin
Member 1507847221-Feb-21 3:00
Member 1507847221-Feb-21 3:00 

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.