PRACTISE SET 1 (5 QUESTIONS)
PRACTICE SET 1
package com.company;
import java.util.Scanner;
public class CWH_PractiseSet01 {
public static void main(String[] args) {
//write a program to add three numbers
// int a= 45;
//float b= 56.88f;
// short c = -1233;
// float sum= a+b+c;
// System.out.print("Sum is:");
// System.out.println(sum);
//// Question2
// float math= 95.4f;
// float physics= 95.0f;
// byte chemistry= 95;
// float sum= math + physics + chemistry;
// System.out.print("The sum of number is:");
// System.out.println(sum);
// float Cgpa=( sum/3)/10f;
// System.out.print("CGPA is:");
// System.out.println(Cgpa);
// Question3
//Scanner sc= new Scanner(System.in);
//
//System.out.println("Enter your sweet name dear");
//String r=sc.next();
// System.out.print("Hello " +r+ " Have a good day !" );
// System.out.println(",have a good day");
// Question4
// Scanner sc= new Scanner(System.in);
// System.out.println("Enter the kilometer");
// float distance= sc.nextFloat();
// float mile= distance*0.621f;
// System.out.println("miles is equal to "+mile);
// Question5
Scanner sc= new Scanner(System.in);
System.out.println("Enter the number");
boolean num= sc.hasNextInt();
System.out.println(num);
}
}
Good
ReplyDelete