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


Introduction

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


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. using System;
  2. public class StringExercise
  3. {
  4. public static void Main()
  5. {
  6. string str;
  7.  
  8. Console.Write("Enter the string : ");
  9. str = Console.ReadLine();
  10. Console.Write("The string you entered is : {0}\n", str);
  11.  
  12. Console.ReadLine();
  13. }
  14. }

Result

C# language techstudy

     





Related Topics




Popular Posts