Topic : Typical output, input, tryparse and escape sequence function for C#.


C# is a kind of programming language which is developed based on C. As an programming language, C# has typical function for output and input which are had many escape sequence and a tryparse function. Output function is a function to show an information to the monitor. Input function is a function to ask an input from the user . Escape sequence function is a function which helps output function to show some special character.  Then tryparse function is a function which helps input function to convert  string type input to the basic type.To declare output function, every programmer need to know the syntax of this functions. Syntax for input function is :

Console.Write(“format-string”,arguments);

Programmer also could use the escape sequence function  by insert it to the “format-string” in the input function. There are many escape sequence that is used in making a programe, such as :

Sequence To show
\n Enter
\t Tab
\\ Backslash
\’ Single quote mark
\” Double quote mark

The programmer also have to know the syntax to declare input function. Syntax for this function is :

Console.ReadLine();

Input function needs a help from the tryparse function. The syntax is :

Ouput-Type.Tryparse(StringVariable, out OutputVariable);

This is the example to use output, input, escape sequence, and tryparse function.

string input;

int output;

Console.Write(“Input Integer : ”);

Input = Console.Readline();

int.TryParse(input, out output);

Console.Write(“Congratulation \n”);

Console.Write(“You have {0} with an integer type”,output);

Programmer must be carefull when they use all of these functions, because they have different syntax.

Iklan

One comment on “Topic : Typical output, input, tryparse and escape sequence function for C#.

Tinggalkan Komentar

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s