Java 1.1 PARAM
Java 1.1 PARAM
Experiment: 1.1
Syntax :
RAM : 8 GB
Operating System : Windows
HackerRank Problem :
University Institute of Engineering
Department of Computer Science & Engineering
Code/Program Code :
import java.io.*;
University Institute of Engineering
Department of Computer Science & Engineering
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Syst
em.in));
int N = Integer.parseInt(bufferedReader.readLine().trim());
if(N>=2 || N<=20){
for(int i=1;i<=10;i++){
System.out.println(N + " x " + i + " = "+ (N*i));
}
}
bufferedReader.close();
}
}
ScreenShot of Code :
University Institute of Engineering
Department of Computer Science & Engineering
University Institute of Engineering
Department of Computer Science & Engineering
ScreenShot of Output :
Syntax :
University Institute of Engineering
Department of Computer Science & Engineering
RAM : 8 GB
Operating System : Windows
Code/Program Code :
ScreenShot of Code :
ScreenShot of Output :
University Institute of Engineering
Department of Computer Science & Engineering
Write a Program to Retrieve Elements from an Array using for each loop.
Syntax :
Code/Program Code :
System.out.println(element);
ScreenShot of Code :
ScreenShot of Output :
University Institute of Engineering
Department of Computer Science & Engineering
Print the Inverted Right Triangle Star Pattern using Nested loop given
below.
University Institute of Engineering
Department of Computer Science & Engineering
A nested loop is a loop within a loop, an inner loop within the body of an
outer one.
Syntax :
//code
Code/Program Code :
int n = 7;
for(int j=0;j<i;j++){
University Institute of Engineering
Department of Computer Science & Engineering
System.out.print("*");
System.out.print("\n");
ScreenShot of Code :
University Institute of Engineering
Department of Computer Science & Engineering
ScreenShot of Output :
Code/Program Code :
public class Experiment1_4 {
for(int i=5;i>4;i++){
System.out.println("Infinite Loop");
ScreenShot of Code :
University Institute of Engineering
Department of Computer Science & Engineering
ScreenShot of Output :
University Institute of Engineering
Department of Computer Science & Engineering
University Institute of Engineering
Department of Computer Science & Engineering
Learning Outcomes :