
Recursivitate

Quiz
•
Computers
•
10th - 11th Grade
•
Hard
Eugenia-Maria Ohota
Used 12+ times
FREE Resource
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
Similar Resources on Wayground
20 questions
Debugging

Quiz
•
10th Grade
16 questions
TỆP VÀ LÀM VIỆC VỚI TỆP

Quiz
•
11th Grade
22 questions
javascript

Quiz
•
11th Grade
22 questions
Java Code Snippets Quiz 1

Quiz
•
10th Grade
20 questions
Lenguaje C

Quiz
•
10th Grade
19 questions
Unit 4: Operators in Java

Quiz
•
9th - 10th Grade
20 questions
Язык программирования Python

Quiz
•
1st - 10th Grade
18 questions
Scanner & If Statements

Quiz
•
5th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade