Professional Documents
Culture Documents
TERM-II , 3 TEST
CLASS : X , SUBJECT : COMPUTER
MARKS : 40
0 1 2 3 4 5
Capacity of A array
A. 5 B. 6 C. 24 D. 48
0 1 2 3 4 5
Size of A array
A. 5 B. 6 C. 24 D. 20
/* A program of Array */
import java.lang.System;
class mm
{
public static void main(String []args)
{
String s1=new String (“Data C”);
Int i , k;
Char c;
for(i=0;i<s1.length();i++)
{
C=s1.charAt(i);
K=s1.indexOf(c);
System.out.print(s1.replace(c,c+1);
K++;
System.out.println(k);
}
13 Output 4
int A [] = new int [6];
A
6 9 65 85 4 25
0 1 2 3 4 5
// A program of Array
Import java.lang.*;
Class base
{
Public static void main(String args[])
{
int A [] = new int[6];
int p=5;
for(int i=0;i<=5;i++)
{
If(a[i]%2==0 && i%2==0)
{
A[i]=A[i]+10+p;
P++;
}
Else
{
A[i]=A[i]-2;
}
P++;
System.out.println(A[i]);
}
System.out.println(p)
}
}
BEST OF LUCK