Write a Program to declare a float variable pi and initialize it with the value of pi till 5 decimal places. Declare an integer variable intpiand store the value of pi in it. You have to print the value of intpi.
Keep the name of your class as Main
Use the System.out.println()statement for printing. Print only the value of intpi
Answers & Comments
public static void main(String...args){
float pi=3.14159f;
int intpi=(int)pi;
System.out.println(intpi);
}
}
// output:::3