package Mobile.OperatorsAndExpressions;
import java.util.Scanner;
public class TypeCasting
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
float a;
int b;
System.out.println("Enter First Number");
a=sc.nextFloat();
System.out.println("Float value is="+a);
b=(int)a;
System.out.println("after typecasting to int the ans is="+b);
}
}
import java.util.Scanner;
public class TypeCasting
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
float a;
int b;
System.out.println("Enter First Number");
a=sc.nextFloat();
System.out.println("Float value is="+a);
b=(int)a;
System.out.println("after typecasting to int the ans is="+b);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.