//https://csprograms4u.blogspot.com/
//Chapter 1
//Program 9
//Type Casting in JAVA
import
java.util.Scanner;
public
class TC
{
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\nThe Answer is="+b);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.