Recursivitate

Recursivitate

10th - 11th Grade

20 Qs

quiz-placeholder

Similar activities

Sains Komputer Tingkatan 4 - 1.3.1 Menjelaskan hubungan

Sains Komputer Tingkatan 4 - 1.3.1 Menjelaskan hubungan

10th - 12th Grade

16 Qs

LATIHAN SOAL PEMROGRAMAN

LATIHAN SOAL PEMROGRAMAN

9th Grade - University

15 Qs

PTS KOMJARDAS SMT GENAP

PTS KOMJARDAS SMT GENAP

10th Grade

20 Qs

Quiz 4

Quiz 4

1st - 10th Grade

20 Qs

Arduino Loop

Arduino Loop

2nd Grade - University

20 Qs

BAI 26 + 27 TIN 10c1

BAI 26 + 27 TIN 10c1

10th Grade

20 Qs

Visualisasi data

Visualisasi data

8th Grade - University

20 Qs

Bylos ir aplankai. Savarankiškas darbas 6 klasei.

Bylos ir aplankai. Savarankiškas darbas 6 klasei.

1st - 10th Grade

17 Qs

Recursivitate

Recursivitate

Assessment

Quiz

Computers

10th - 11th Grade

Practice Problem

Hard

Created by

Eugenia-Maria Ohota

Used 12+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

Subprogramul f este definit mai jos.

long f(int n)

{

if(n<=0) return 0;

else return f(n-1)+2*n;}

Dacă f(x) are valoarea 10100, care este valoarea lui x?

2.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Subprogramul f este definit mai jos.

long f(int n){

if(n<=0) return 0;

else return f(n-1)+n;}

Ce se afișează la apelul f(10)

10

55

0

110

3.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Subprogramul f este definit mai jos.

long f(int n){

if(n<=0) return 0;

else return f(n-1)+1;}

Ce se afișează la apelul f(10)

10

55

0

110

4.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Considerăm subprogramul f, definit mai jos. Care va fi valoarea variabilei globale x după apelul f(4962,x), dacă înainte de apel, x are valoarea 0?

void f(int n,int &a)

{int c;

if(n!=0){ c=n%10; if(a<c) a=c;

f(n/10,a); }}

0

2

9

4

5.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

Considerăm subprogramul f, definit mai jos. Care va fi valoarea variabilei globale x după apelul f(4962,x), dacă înainte de apel, x are valoarea 100?

void f(int n,int &a)

{int c;

if(n!=0){ c=n%10; if(a<c) a=c;

f(n/10,a); }}

100

2

9

4

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Se consideră subprogramul f, definit mai jos. Indicați ce valoare are f(15, 25).

int f(int a,int b)

{ if (b==0) return a;

else return f(b,a%b);

}

15

10

5

0

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Se consideră subprogramul f, definit mai jos.

int f(int x)

{ if(x<=0)

return 0;

return x+f(x-5);

}

Care este rezultatul apelului f(20)?

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?