
Recursivitate
Quiz
•
Computers
•
10th - 11th Grade
•
Practice Problem
•
Hard
Eugenia-Maria Ohota
Used 12+ times
FREE Resource
Enhance your content in a minute
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
17 questions
ÔN TẬP CUỐI KỲ II TIN 8
Quiz
•
8th - 11th Grade
16 questions
Java by Mr Sam
Quiz
•
10th Grade
20 questions
Structure of a Webpage
Quiz
•
10th Grade
15 questions
حاسب 2
Quiz
•
10th Grade
20 questions
Ulangan TIK Analisi Data
Quiz
•
10th Grade
16 questions
DATA SCIENCE Assessment (April)
Quiz
•
8th - 12th Grade
20 questions
KTTX lần 01 Tin 11
Quiz
•
11th Grade
20 questions
Intro to IT Ch 3 Quiz Review
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
