Home
About
FAQs
System Requirements
In the news
Workshops
Training
Training Calendar
Request for Training
Training Status
Registration
For Teachers
For Students
For Schools
Contact us
Login
Languages
English
हिंदी
മലയാളം
मराठी
ಕನ್ನಡ
you are here->
home
->
Class 12
->
Fibonacci (String)
Fibonacci (String)
Theory
Theory
Procedure
Simulator
Viva Voce
Resources
Feedback
1)
What is the purpose of the given program?
To print the sum of digits of a given number.
To print the Fibonacci sequence up to a given number.
To print prime numbers up to a given number.
To print the factors of a given number.
2)
What is the value of the variable "last" initially?
0
1
"a"
"b"
3)
What is the value of the variable "last2" initially?
0
"b"
"a"
1
4)
What happens if a negative number is given as input?
The program prints "incorrect input" and terminates.
The program prints nothing and terminates.
The program prints "b" and terminates.
The program prints "a" and terminates.
5)
What will be the output if the input is 0?
The program prints "b" and terminates.
The program prints "a" and terminates.
The program prints "incorrect input" and terminates.
The program prints nothing and terminates.
6)
What will be the output if the input is 1?
The program prints "a" and terminates.
The program prints the first two numbers of the Fibonacci sequence and terminates.
The program prints nothing and terminates.
The program prints "b" and terminates.
7)
What does the "for" loop do in the program?
It prints the squares of the numbers up to the given number.
It prints the even numbers up to the given number.
It prints the odd numbers up to the given number.
It prints the Fibonacci sequence up to the given number.
8)
What is the value of "fib" in each iteration of the "for" loop?
The product of the previous two numbers in the Fibonacci sequence.
The difference between the previous two numbers in the Fibonacci sequence.
The sum of the previous two numbers in the Fibonacci sequence.
The quotient of the previous two numbers in the Fibonacci sequence.
9)
What is the output of the program if the input is 3?
a
b
b, a, ab
a, b, ba
10)
What is the purpose of the "int(input())" line in the program?
It prints the Fibonacci sequence up to a given number.
It takes the input from the user.
It prints the squares of the numbers up to a given number.
It prints the even numbers up to a given number.