Student Name Shivam Anand Branch CSE
UID 21BCS3276 Secton/ 21BCS-610 A
Group
Date of
Performance 17-August-2022 Subject OOPs using
Name Java
Semester 3rd Subject Code 21CSH-218
Experiment Number :
1.1
AIM OF THE EXPERIMENT :- Write a program to print table by taking input from the
user. In the form of “2 x 1 = 2”.
Objective :-We will be able to learn & implement different types of loops.
Source Code:
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader([Link]
));
int N = [Link]([Link]().trim());
for( int i=1;i<=10;i++)
{
[Link](N+" x "+i+" = "+i*N);
}
[Link]();
}
}
Output:
Code Link: [Link]
Java/blob/d652d38e704170373ff4eb17217c23b39e349bf8/Exp%201.1
AIM OF THE EXPERIMENT :- Write a program to print in the form of (a+20b),
(a+20b+21b), ……, (a+20b+21b+…..+2n-1b), where the values of a & b are taken from the
user.
Source Code:
import [Link].*;
import [Link].*;
import [Link];
class Solution{
public static void main(String []argh){
Scanner in = new Scanner([Link]);
int t=[Link]();
int d=0;
for(int i=0;i<t;i++){
int a = [Link]();
int b = [Link]();
int n = [Link]();
for ( int j=1;j<=n;j++)
{
d = (int)[Link](2,j);
int c = a + b*(d-1);
[Link](c+" ");
}
[Link]();
}
[Link]();
}
}
Output:
Code Link: [Link]
Learning outcomes (What I have learnt):
1. Understand the basic concepts of Java.
2. Learnt about the loops & syntax of it.
3. Learnt about the math library & power function.
Evaluation Grid :
Sr. No. Parameters Marks Obtained Maximum Marks
1. Student Performance 12
(Conduct of experiment)
objectives/Outcomes.
2. Viva Voce 10
3. Submission of Work Sheet 8
(Record)
Total 30