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?
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)?
20 questions
Fungsi Rekursif dan fibonacci
Quiz
•
11th Grade
18 questions
Pemrograman C++ (Dasar)
Quiz
•
11th Grade
15 questions
С++ введение
Quiz
•
10th Grade
15 questions
Structuri neomogene
Quiz
•
9th - 12th Grade
20 questions
Lenguaje C
Quiz
•
10th Grade
16 questions
Structuri repetitive în C++
Quiz
•
9th - 12th Grade
18 questions
Символьные строки. Контрольный тест.
Quiz
•
10th Grade
15 questions
Struktur Kontrol Perulangan, Array, dan Function (Bahasa C)
Quiz
•
10th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade
20 questions
Distance, Midpoint, and Slope
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
20 questions
Understanding Linear Equations and Slopes
Quiz
•
9th - 12th Grade