Q:

Write a C# program to accept a string from keyboard and print it

0

Write a C# program to accept a string from keyboard and print it

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..

using System;
public class StringExercise
{
    public static void Main()
    {
        string str;
 
        Console.Write("Enter the string : ");
        str = Console.ReadLine();
        Console.Write("The string you entered is : {0}\n", str);
 
        Console.ReadLine();
    }
}

Result:

Enter the string : Techstudy - The complete debugging solution

The string you entered is : Techstudy - The complete debugging solution

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now