WorksheetsRobotics Quiz
Total questions: 8
Worksheet time: 8mins
How many times will the loop execute?
unsigned char half_limit = 150;
for (unsigned char i = 0; i < 2 * half_limit; ++i)
{
// do something
}
150
500
Infinite
what will be the value of "i" and "j" when the following code is executed?
int i =10;
int j = i++;
i =11, j= 11
i = 11, j = 10
i = 10, j = 11
i = 10, j = 10
How do you create a variable with the floating Number 2.8?
int x = 2.8;
x = 2.8;
double x = 2.8;
byte x = 2.8
Which header file lets us work with input and output objects?
#include <stream>
#include <iostream>
#include <inputstr>
#include <iosstring>
How do you start writing a while loop in c++?
x > y whlle {
while x > y {
while x > y:
while (x > y)
what is the correct syntax to output "hello world" in c++?
System.out.println("hello world");
cout << "hello world";
print ("hello world");
Console.Writeline("hello world");
Does both the loops in the following program print the correct string length?
Yes, Both the loops print the correct length
Only for loop prints the correct length
Only while loop prints the correct length
Compile error in the program
What is the output of the program?
5
Address of "x"
Compile error
10
