using System;
namespace ImplicitTypeCoercionDemo
{
public class Program
public static void Main(string[] args)
// Declare variables with different data types
int intVar = 42;
float floatVar = 3.14f;
double doubleVar;
// Implicit type coercion from int to float
// intVar is automatically converted to float before the addition
float sum = intVar + floatVar;
Console.WriteLine("Sum of int and float: " + sum);
// Implicit type coercion from float to double
// floatVar is automatically converted to double before the assignment
doubleVar = floatVar;
Console.WriteLine("Value after implicit conversion from float to double: " + doubleVar);
}