A number with any type i.e., it might be int or double or decimal, it may be displayed as a percent(%) during the output.
It can be displayed likewise as setting the format type value in the ToString() method as shown in the below example.
decimal dec = 123.554466;
string s = dec.ToString("P2");
Asked In: Many Interviews |