21BEC2059 17 - 03 - 2022 (K. Pradeep)
21BEC2059 17 - 03 - 2022 (K. Pradeep)
21BEC2059 17 - 03 - 2022 (K. Pradeep)
Pradeep
COMPUTER ASSINGNMENT – 3
1.
System.out.println(cars[0]);
Output:
2.
cars[0] = "Opel";
System.out.println(cars[0]);
}
}
Output:
3.
System.out.println(cars.length);
Output:
4.
System.out.println(cars[i]);
}
Output:
5.
System.out.println(i);
Output:
6.
Output:
7.
System.out.println(txt.toUpperCase());
System.out.println(txt.toLowerCase());
Output:
8.
System.out.println(txt.indexOf("locate"));
Output:
9.
Output:
10.
System.out.println(firstName.concat(lastName));
Output:
11.
System.out.println(txt);
Output:
12.
System.out.println(txt);
Output:
13.
System.out.println(txt);
Output:
14.
System.out.println(txt);
Output:
15.
System.out.println(txt);
Output:
Code:
stbuilder.reverse();
System.out.println(stbuilder);
}
Output:
Code:
System.out.println("Before swap");
first = second;
second = temporary;
System.out.println("After swap");
}
Output:
Code:
int r,sum=0,temp;
temp=n;
while(n>0){
sum=(sum*10)+r;
n=n/10;
if(temp==sum)
else
System.out.println("not palindrome");
}
}
Output: