OutputBasedonArray
OutputBasedonArray
3) Show the value of the given array after executing the following code segment
Int a[] = {2,4,6,8,10];
a[0] +=a[4]++;
a[2]+= ++a[3];
a[4]/=a[1]++;
8) What is the result of the following statement on the basis of given array?
int Num[ ]={3,5,10,12,8};
System.out.println(Num[2]+ “\t”+ (Num[1]*10));
System.out.println( Num[3]-5 + “\t” + Num[4-2]);
11) What is wrong in the following code? Explain. Also write correct form of the
following:
int u[]=new int [6];
u={2,5,6,7,8,9};
13) write a valid java statement to declare and also initialize a character array of
Uppercase vowels.
17) State the total size in bytes, of the array a[4] of char data type and p[4] of float
data type.
18) Write a statement to find the length of a character array named ch.