You are on page 1of 2

Experiment No. 1.

Student Name: ABHAY SINGH UID: 21BCS5954


Branch: BE-CSE Section/Group: 812/A
Semester: 3rd Date of Performance: 31/08/22
Subject Name: OOPS-JAVA Subject Code: 21CSH-218

1. Aim of the practical:


Given a string A , print Yes if it is a palindrome, print No otherwise.

2. Objective: We will be able to learn about Palindrome.

3. Program Code:

import java.io.*;
import java.util.*;

public class Solution {

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);


String A=sc.next();
String rev="";
/* Enter your code here. Print output to STDOUT. */
for(int i=A.length()-1;i>=0;i--){
rev=rev+A.charAt(i);
}if(rev.equals(A)){
System.out.println("Yes");
}else{
System.out.println("No");
}

}}
Output:

Learning outcomes (What I have learnt):

1. Learn about Palindrome.

2. Learn how to optimize code.

3. Learn about statements and loops.

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 8
Sheet
(Record)
Total 30

You might also like