Answer: 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.
Example:
decimal dec = 123.554466;
string s = dec.ToString("P2");
Output:
123.55%
Asked In: Many Interviews |
Alert Moderator