Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are floating point literals in C#?
A floating-point literal has an integer part, a decimal point, a fractional part, and an exponent part. You can represent floating point literals either in decimal form or exponential form.
The following are some of the examples of floating point literals −
9.23456 269485E-5F
Let us now print the floating point literals −
Example
using System;
namespace Demo {
class Program {
static void Main(string[] args) {
// float
float a = 3.56f;
Console.WriteLine(a);
// float
float b = 3.14159f;
Console.WriteLine(b);
}
}
}
Output
3.56 3.14159
Advertisements