Java Development
Відкрити в Telegram
Learn something new in quality Instagram Link Java_Quizs https://instagram.com/java_quizs?utm_medium=copy_link
Показати більшеКраїна не вказанаТехнології та додатки34 716
2 283
Підписники
Немає даних24 години
Немає даних7 днів
Немає даних30 день
Архів дописів
2 283
/* Question - 11
Java Program To Find Given Year Is Leap Year Or Not
*/
package ABC;
import java.util.*;
public class Main {
public static void main(String[] args) {
int year;
Scanner s = new Scanner(System.in);
System.out.print("Enter The Year :");
year = s.nextInt();
if(((year%4==0) && (year % 100!= 0)) || (year%400 == 0))
{
System.out.println(year+" Is A Leap Year");
}
else
{
System.out.println(year+" Is Not A Leap Year");
}
}
}
2 283
#Quiz_Java (Question - 86)
Identify the invalid signature for main method which is an entry point in a class
2 283
#Quiz_Java (Question- 85)
How many public classes can be created in a Java program?
2 283
/* Question - 10
Java Program To Find The GCD Of Given Numbers
*/
package ABC;
import java.util.*;
public class Main {
public static void main(String[] args) {
int X,Y,GCD=1;
Scanner s = new Scanner(System.in);
System.out.println("Enter The Value X:");
X = s.nextInt();
System.out.println("Enter The Value Y:");
Y = s.nextInt();
for(int i=1;i<=X && i<=Y;i++)
{
if(X%i==0 && Y%i==0)
{
GCD = i;
}
}
System.out.println("Gcd Of "+X+" And "+Y +" Is : "+GCD);
}
}
2 283
/* Question - 09
Java Program To Find The LCM Of Given Number Using GCD Method
*/
package ABC;
import java.util.*;
public class Main {
public static void main(String[] args) {
int X,Y,GCD=1,LCM;
Scanner s = new Scanner(System.in);
System.out.println("Enter The Value X:");
X = s.nextInt();
System.out.println("Enter The Value Y:");
Y = s.nextInt();
for(int i=1;i<=X && i<=Y;i++)
{
if(X%i==0 && Y%i==0)
{
GCD = i;
}
}
LCM = (X * Y) / GCD;
System.out.println("Lcm Of "+X+" And "+Y +" Is : "+LCM);
}
}
2 283
Fibonacci Sequence Explanation In Telugu 🥳🥳🥳
https://www.instagram.com/p/CYoukonFy9p/?utm_medium=copy_link
2 283
#Quiz_Java (Question - 83)
The “.class” file has the same name as the class defined in the program.
2 283
/* Question - 08
Java Program To Find Whether The Given Number Is Prime Number Or Not
*/
package ABC;
import java.lang.Math;
import java.util.*;
public class Main {
public static void main(String[] args) {
int Num,Count=0;
Scanner s = new Scanner(System.in);
System.out.print("Enter The Number :");
Num = s.nextInt();
if(Num==0 || Num==1)
{
System.out.println(Num+" Is Not A Prime Number");
}
else
{
for(int i=2;i<Num;i++)
{
if(Num%i==0)
{
Count++;
break;
}
}
if(Count == 0)
{
System.out.println(Num+" Is A Prime Number");
}
else
{
System.out.println(Num+" Is Not A Prime Number");
}
}
}
}
2 283
/* Question - 07
Java Program To Find Whether The Given Number Is Prefect Number Or Not
*/
package ABC;
import java.util.*;
public class Main {
public static void main(String[] args) {
int Num,Count=0,Sum=0,Var;
Scanner s = new Scanner(System.in);
System.out.print("Enter The Number :");
Num = s.nextInt();
Var = Num;
for(int i=1;i<Num;i++)
{
if(Num%i==0)
{
Sum = Sum + i;
}
}
if(Sum==Var)
{
System.out.println(Num+" Is A Perfect Number");
}
else
{
System.out.println(Num+" Is Not A Perfect Number");
}
}
}
2 283
#Quiz_Java (Question - 82)
If a Java program has 4 classes then how many class files will be generated after compilation?
2 283
🔥WIN Cash Prize upto Rs. 30 Lacs🔥
Participate in CodeKaze by CodingNinjas | Largest Coding Competition
📌 Internships, Jobs hiring for top 10,000 students in 100+ companies like CoinDCX, Wingify, Tokopedia etc.
Duration : 3 hrs
Date: 6 March '22
FREE Registration Link : https://rebrand.ly/codekaze2
Register now💥🙌
Share with your batchmates✅
Note : Free Of Cost No Need To Pay Money.
2 283
#Quiz_Java (Question - 81)
How many classes can a Java program can have?
2 283
Inheritance Concept Java 👇 Click Below
https://www.instagram.com/p/CRynoOVDwdx/?utm_medium=copy_link
2 283
/* Question - 06
Java Program To Find Quadratic Equations
*/
package ABC;
import java.lang.Math;
import java.util.*;
public class Main {
public static void main(String[] args) {
double A,B,C;
double P,Q;
Scanner s = new Scanner(System.in);
System.out.print("Enter The Value Of A :");
A = s.nextDouble();
System.out.print("Enter The Value Of B :");
B = s.nextDouble();
System.out.print("Enter The Value Of C :");
C = s.nextDouble();
double discrement = B*B-4*A*C;
if(discrement>0)
{
P = ((-B+Math.sqrt(discrement))/2*A);
Q = ((-B-Math.sqrt(discrement))/2*A);
System.out.printf("The Quadratic Equations Are P:"+P+" Q:"+Q);
}
else if (discrement == 0.0)
{
double r1 = -B / (2.0 * A);
System.out.println("The root is " + r1);
}
else
{
System.out.println("Roots are not real.");
}
}
}
2 283
/* Question - 05
Java Program To Find The Sum Of Digits Of A Given Number
*/
package ABC;
import java.util.*;
public class Main {
public static void main(String[] args) {
int Num,Rem,Sum=0;
Scanner s = new Scanner(System.in);
System.out.print("Enter The Number :");
Num = s.nextInt();
while(Num!=0) {
Rem = Num%10;
Sum = Sum+Rem;
Num = Num/10;
}
System.out.println("Sum Of Digits Of A Number :"+Sum);
}
}
2 283
#Quiz_Java (Question - 80)
Which of these is correct way of inheriting class A by class B?
