Professional Documents
Culture Documents
Computer Question Paper 2023 Solutions
Computer Question Paper 2023 Solutions
pl
ify
Le
ar
ni
ng
Am
pl
ify
Le
ar
ni
ng
Am
pl
ify
Le
ar
ni
ng
Am
pl
ify
Le
ar
ni
ng
Am
pl
ify
Le
ar
ni
ng
Am
pl
ify
Le
ar
ni
ng
Am
pl
ify
Le
ar
ni
ng
import java.util.Scanner;
class Student
{
String name;
int age;
int mks;
String stream;
void accept()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter your name");
name = sc.nextLine();
g
System.out.println("Enter your age");
age = sc.nextInt();
n
System.out.println("Enter your marks");
mks = sc.nextInt();
}
ni
void allocation()
{
if(mks>=300)
stream = "Science and Computer";
else if(mks>=200 && mks<300)
ar
Le
stream = "Commerce and Computer";
else if (mks>=75 && mks<200)
stream = "Arts and Animation";
else if(mks<75)
stream = "Try Again";
}
ify
void print()
{
System.out.println("Name : "+ name);
pl
class BubbleSort
{
public static void main(String[] args)
{
//Character Array lena tha
char a[] = new char[10];
g
Scanner sc = new Scanner(System.in);
n
System.out.println("Enter 10 characters");
ni
for(int i=0; i<a.length; i++)
a[i] = sc.nextLine().charAt(0); //char input
char t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
Am
}
}
g
}
n
void print(int n)
{
int sum_even = 0, sum_odd = 0;
ni
int temp = n; //to save the original no.
while(temp!=0)
{
int d = temp%10; ar
Le
if(d%2 == 0) //even condition
sum_even += d;
else // for odd digits
sum_odd += d;
temp = temp/10;
ify
if(sum_even == sum_odd)
System.out.println(n+" is a lead number");
pl
else
System.out.println(n+" is not a lead number");
}
Am
n
class Frequency
{
public static void main(String[] args)
ni
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter a String");
String s = sc.nextLine();
else if(Character.isLetter(c))
a++;
else
sp++;
pl
class LinearSearch
g
{
public static void main(String[] args)
n
{
double a[] = new double[20];
ni
Scanner sc = new Scanner(System.in);
}
a[i] = sc.nextDouble(); ar
Le
System.out.println("Enter the value to be searched?");
double x = sc.nextDouble();
//Linear Search
int pos = -1; //position of found element
ify
pos = i;
break;
}
Am
if(pos != -1)
System.out.println("Element is found at "+pos);
else
System.out.println("Element is not found.");
}
}
g
import java.util.Scanner;
n
class Sum_1_2_Digit
{
public static void main(String[] args)
ni
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter 10 values into the Array");
int a[] = new int[10];
for(int i=0; i<10; i++)
a[i] = sc.nextInt();
ar
Le
int sum1 = 0, sum2 = 0; //sum variables