Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
final revision sheet prep3.doc
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
833.02 Кб
Скачать

12. The result of the following Code is :

Dim N As Integer Dim S As Integer For N = 1 to 100 S=S +N Next Label1.Text = S

a) Displaying the numbers from 1 to 100.

b) Displaying the sum of the numbers from 1 to 100.

c) Displaying the product of the numbers from 1 to 100.

Q

I

X

0

4.5*2 = 9

3

9*2 = 18

6

18*2 = 36

.13: Trace the following code segment, showing the value of each variable each time it changes:

  1. X = 4.5

  2. For I = 0 To 7 Step 3

  3. X = X * 2

  4. Next

Q.14: Upon executing the following codes:

  • D

    H

    R

    0

    1

    2

    4

    4

    16

    im H , R As Integer

  • For H = 0 To 5 Step 2

  • R = 2^H

  • Next

  1. (H) Value is …………...…..…..

  2. (R) Value is …………..………..

Q.15: Third: Answer the following

1- Specify the value of each variable after executing the following Code.

Dim N, K, C As Integer

C = 10

For N = 1 To 10 Step 5

K = K + N

Next

If N >= C Then

C = C + 1

End If

Variable

Value

C

11

K

7

N

11

28

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]