Core Java Programming Challenges #4 | Coding Challenges | Naresh IT

preview_player
Показать описание
Core Java Programming Challenges #4 | Coding Challenges | Naresh IT

💡 Also Watch

Java Programming Tutorials by Mr.Hari krishna:
Advanced Java Programming Tutorials by Mr.Nataraj:

Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Websites
#CoreJava_Programing #Challenges #CoreJava #Quiz
--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

--------------------------

💡 Check The Below Links

Рекомендации по теме
Комментарии
Автор

public class Challenge4 {

public static void main(String[] args) {
Random r = new Random();
for (int i=1; i<= 10; i++)
{



}
}
}

SaritaSinghsarita
Автор

/*
print 20 random values between 100 and 200
*/
import java.util.Random;

public class Test{
public static void main(String[] args){
Random rn = new Random();
int count = 0;
while(count<20){
int x = rn.nextInt(200);
if(x>99){
count++;
System.out.println(x);
}
}
}
}

kishoremsvr
Автор

public static void main(String[] args) {

Random r = new Random();

int count = 0;
for(int i = 1; i <= 20; i++) {
int num = r.nextInt(100, 200);
System.out.println("Random number : "+num);
count++;
}
System.out.println("Total numbers printed : "+count);
}

govindashivhare
Автор

does it need so many loops?
🤔🤔🤔🤔🤔

Random r =new Random();

for(int i =0; i<20; i++)
{
int a = r.nextInt(100, 200);

System.out.println(a);
}

kasungamage
Автор

//20 random values range of 100 and 200

import java.util.Random;
class Main {
public static void main(String[] args) {
Random rand = new Random();
for(int i=1; i<=20;i++){
int n = rand.nextInt(100, 200);
System.out.println(n);
}

}
}

patilpatade
Автор

import java.util.Random;
public class Exercise4 {
public static void main(String[] args) {

Random r = new Random();

for (int i = 0; i <= 20; i++){
int x = r.nextInt(100)+100;
System.out.println(x);
}
}
}

isurid.keshani
Автор

Random random=new Random();
int count=0;
While (true){
Int x=random.nextInt(200)+100;
If (x<200){
System.out.println(x);
count++;
}
If count>20
Break;
}

yuuno
Автор

public static void main(String[] args) {
Random r = new Random();
int count = 0;
while(count < 20){
int x = r.nextInt(200);
if(x > 100){
System.out.println(x);
count++;
}
}
}
}

MaulikSakhida
Автор

import java.util.Random;
public class Challenge4
{
public static void main(String []args){
int count=1;
do{


for(int i=1;i<=count;i++)
{

Random r=new Random();
int a=r.nextInt(200);
if(count<=20 && a>=100 && a<=200)
{
System.out.println(a);
count++;
}

}
}
while(count<=20);
}
}

danyalaabid
Автор

package challenges;

public class Random {
public static void main(String[] args) {

java.util.Random r = new java.util.Random();
int low = 100;
int high = 200;
for(int i=0;i<20;i++){
int result = r.nextInt(high-low) + low;
System.out.println(result);
}
}
}

rajumanchikatla
Автор

package test;
import java.util.Random;
class Pattern{
public static void main(String[] args) {
int count=0;
Random r=new Random();
while(true) {
int x=r.nextInt(200);
if(x>=100) {
System.out.println(x);
count++;
}
if(count==20)
break;
}
}
}

raviranjan
Автор

public class RandomNumber {

public static void main(String[] args) {
Random r= new Random();
for(int i=1;i<=20;i++)
{
int x=r.nextInt(200);// generate the random value from 0 to 200
if(x<100)
{

}
else
{
System.out.println(x);
}
}
}
}

shilpar
Автор

import java.util.Random;
public class four {
public static void main(String[] args) {
Random rd=new Random();
int count=0;
for(int i=0;count<20;i++) {
int x = rd.nextInt(200);
if (x >= 100) {
System.out.println(x);
count++;
}

}
System.out.println("The total numbers printed is "+count);
}
}

brainrott-db
Автор

public class Test {

public static void main(String[] args) {
int count=0;
System.out.println("Random no are : ");
Random r = new Random();
for(int i=0;i<100;i++)
{
int x = r.nextInt(200);
if(x>99)
{
System.out.println(x);
count++;
if(count>=20)
{
break;
}
}
}
System.out.println("count : "+count);

}
}

pritipatil
Автор

public static void main(String[] args) {
Random random = new Random();
for (int i=0; i<20; i++) {
int nextInt = random.nextInt(100, 200);

}

shahzaibkhuwaja
Автор

public static void main(String[] args)
{
Random rn=new Random();

for(int i=1;i<200;)
{
int x=rn.nextInt(200);
if(x>=0&&x<100)
continue;
System.out.println(x);
if(i==20)
break;
i++;
}


}

sreedharkamera
Автор

Sir this logic should also work :)
import java.util.Random;

public class Challange4 {
public static void main(String[] args) {
int a;
Random r=new Random();
for(int i=0;i<20;i++)
{
a=r.nextInt(200);
if(a<100)
System.out.println(a+100);
else
System.out.println(a);
}
}
}

rohanjha
Автор

Hi Srinivas, I tried but got different outputs. could you please make a video on this challenge thanking you in advance.

PradeepKumar-fqfz
Автор

public class RandomNumberInRange {

public static void main(String args[]) {
int count=0;
while(true) {
System.out.println(randomNumberInRange(100, 200));
count++;
if(count>20)
break;
}
}

private static int randomNumberInRange(int min, int max) {

if(max<=min) {
throw new IllegalArgumentException("Max should not be less than or equal to min");
}

Random r = new Random();
return r.nextInt((max-min)+1) +min;

}

}

jaisreeramprasad
Автор

import java.util.Random;

public class Challenge4 {
public static void main(String args[]){
Random random = new Random();
int count = 0;
while(true){
if(count>=20)
break;
int r = random.nextInt(200);
if(r>100){
System.out.println(r);
count++;
}
}
}
}

samahmahdi
visit shbcf.ru