
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
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
- Related Articles
- Integer literals vs Floating point literals in C#
- What is the difference between integer and floating point literals in Java?
- What are C++ Floating-Point Constants?
- Explain what floating point numbers are and what types of floating points are available in Swift
- Why are floating-point calculations inaccurate in Python?
- What are literals in Java?
- What are literals in C++?
- What are Literals in Python?
- What is Floating-Point Representation in Computer Architecture?
- What are JSP literals?
- Floating-point hexadecimal in Java
- Floating point comparison in C++
- What is the precision of floating point in C++?
- What are Boolean literals in Java?
- What are Boolean Literals in C++?

Advertisements