wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IEEE Coding Competition

Total questions: 13

Worksheet time: 23mins

Name
Class
Date
1.

What is the character position of "o" in "song"?

a)

0

b)

1

c)

2

d)

3

2.

What data type would you use for storing the number of students in a class?

a)

boolean

b)

String

c)

double

d)

int

3.

What will be the Output of the below code:

public class Demo{

public static void main(String[] arr){

}

public static void main(String arr){

}

}

a)

Hi

b)

Error

c)

Nothing

d)

Finite

4.

What is the output of the below Java code snippet?

char ch = 'A';

int a = ch + 1;

ch = (char)a;

System.out.println(ch);

a)

66

b)

A

c)

65

d)

B

5.

What is the size of float and double in java?

a)

32 and 64

b)

32 and 32

c)

64 and 64

d)

128 and 64

6.

Select the valid statement.

a)

char[] ch = new char()

b)

char[] ch = new char[]

c)

char[] ch = new char(5)

d)

char[] ch = new char[5]

7.

Identify the output of the following program.

String str = “abcde”;

System.out.println(str.substring(1, 3));

a)

abc

b)

bc

c)

bcd

d)

cd

8.

Find the output of the following code:

int ++a = 100;

System.out.println(++a);

a)

100

b)

Error

c)

101

d)

None

9.

You need to run the code 10 times. Fill in the missing code parts:

for (int i = 0; (a)   ; i++ ){

System.out.println(i);

}

10.

Correct the following code to produce the following output:

**********

**********

**********

**********

for (int i = 1; i<=10; i++){        

for (int j = 1; j<=5;j++){              

System.out.print(j);         }        

System.out.println();     }

4 lines
11.

You need to print "IEEE" 5 times. Fill in the missing code parts:

int z = 10;

while (z > 0){

if (z%2 == 0)

System.out.println("IEEE");

}

4 lines
12.

What data type would you use for storing the emails of employees?

a)

char

b)

long

c)

String

d)

double

13.

Write a code in any language to print IEEE like the picture shown (USE LOOPS).

4 lines