Quiz 2 on Data Structure and Algorithm online

Who is the father of C language?
Dennis Ritchie
Steve Jobs
James Gosling
Rasmus Lerdorf
Which of the following is not a valid C variable name?
Int number;
float rate;
Int variable_count;
Int $main;
All keywords in C are in ____________
LowerCase letters
UpperCase letters
CamelCase letters
None of the mentioned
Which of the following is true for variable names in C?
They can contain alphanumeric characters as well as special characters
Variable names cannot start with a digit
It is not an error to declare a variable to be one of the keywords(like goto, static)
Variable can be of any length
C is a which level language.?
Low Level
High Level
Low + High
None
High level language is a .?
Language which is difficult to understand and not human readable.
Language with big program size.
Language with small program size.
Human readable like language.
Which program outputs "Hello World.." .?
Main() { scan("Hello World.."); }
Main() { print("Hello World.."); }
Main() { printf("Hello World.."); }
Main() { scanf("Hello World.."); }
C language was invented in which laboratories.?
Uniliver Labs
IBM Labs
AT&T Bell Labs
Verizon Labs
C language was invented to develop which Operating System.?
Android
Linux
Ubuntu
Unix
A C program is a combination of.?
Statements
Functions
Variables
All of the above
Which is valid C expression?
Int my_num = 100,000;
Int my_num = 100000;
Int my num = 1000;
Int $my_num = 10000;
Which of the following cannot be a variable name in C?
Volatile
True
friend
Export
What is an example of iteration in C?
For
While
Do-while
All of the mentioned
Correct way of commenting a single line is.?
/*printf("Hello C.."); printf("How are you.");
//printf("Hello C.."); printf("How are you.");
/*printf("Hello C.."); printf("How are you.");*/
/printf("Hello C..");/ printf("How are you.");
What is an Identifier in C Language.?
Name of a Function or Variable
Name of a Macros
Name of Structure or Union
All the above.
Choose correct statements
A constant value does not change. A variable value can change according to needs.
A constant can change its values. A variable can have one constant value only.
There is no restriction on number of values for constants or variables.
Constants and Variables can not be used in a singe main function.
Find an integer constant.
3.145
34
"125"
None of the above
Find a Floating Point constant.
12.3E5
12e34
125.34857
All the above.
Choose a right statement.
Int myage = 10; int my_age = 10;
Int myage = 10; int my,age = 10;
int myage = 10; int my age = 10;
All are right
Each statement in a C program should end with.?
Semicolon ;
Colon :
Period . (dot symbol)
None of the above.
What is the other name for C Language ?: Question Mark Colon Operator.?
Comparison Operator
If-Else Operator
Binary Operator
Ternary Operator
Choose a syntax for C Ternary Operator from the list.
Condition ? expression1 : expression2
condition : expression1 ? expression2
Condition ? expression1 < expression2
Condition < expression1 ? expression2
What is the output of the C statement.?
4
3
5
2
Choose a correct statement regarding C Comparison Operators.
(x == y) Is x really equal to y. (x != y) Is x not equal to y.
(x < y) Is x less than y (x > y) Is x greater than y
X <= y) Is x less than or equal to y. (x >= y) Is x greater than or equal to y
All the choices
Choose a correct C Statement using IF Conditional Statement.
If( condition ) { //statements; }
If( condition ) { //statements; } else { //statements; }
If( condition1 ) { //statements; } else if( condition2) { //statements; } else { //statements; }
All the above.
What is the output of the C Program.?
Yes
Hurray.. (new line) Yes
Hurray..Yes
Compiler error
What is the output of the C Program.?
England
Hurray..
Compiler error for missing else
None of the above
__________ are reserved words that have special meaning in the C language.
Keywords
Variables
Comments
Syntax
In C language _______ are the names given to variables, constants, functions, and user-defined data.
identifiers
Keywords
Variables
Syntax
Which of the following is not an example of arithmetic operator symbol in C.
*
+
//
++
Which symbol is a valid relational operator in C.
//
>=
&&
!
Which of the following symbol represents Logical OR in C?
||
&&
==
!
Which of the following symbol represents left shift in C?
<<
&&
!
==
Which of the following assignment operator in C is used to divides left operand with the right operand and assigned the result to the left operand
/=
+=
*=
//
The if statement may be implemented in different forms depending on the complexity of conditions to be tested which of the following is not included in decision makign?
Nested for
If....else statement
Simple if statement
Using else if statement
In Simple if statement If the expression returns true, then the statement-inside will be executed, otherwise statement-inside is skipped and only the statement-outside is executed.
True
False
In if statement, a single statement cannot be included without enclosing it into curly braces { ... }
True
False
Switch statement is a control statement that allows us to choose only one choice among the many given choices.
True
False
In Switch statement we use those expressions to evaluate switch case, which may return floating point values or strings or characters.
True
False
In Switch case statement in C default case is executed when none of the mentioned case matches the switch expression.
True
False
In any programming language including C, ________ are used to execute a set of statements repeatedly until a particular condition is satisfied.
Loops
Switch
Case
Return
The following are types of loops except for one which is?
For
While
Do while
Switch
The following are parameters in a loop except for one which is?
Return
Initialization
Condition
Incrementation/decrementation
In for loop we have exactly two semicolons, one after initialization and second after the condition.
True
False
When break statement is encountered inside a loop, the loop is immediately exited and the program continues with the statement immediately following the loop
True
False
Which of the following symbol should be used to increment a value by 1
+1
++
^1
None of the choices
Which of the following symbol should be used to decrement a value by 1
-1
~1
--
++
The expression causes the control to go directly to the test-condition and then continue the loop process.
Break
Continue
Default
Loop
In C we can also have nested for loops,
True
False
{"name":"Quiz 2 on Data Structure and Algorithm online", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Who is the father of C language?, Which of the following is not a valid C variable name?, All keywords in C are in ____________","img":"https://www.quiz-maker.com/3012/CDN/82-3888719/data-struc1.jpg?sz=1200-00000000000829705300"}
Make your own Survey
- it's free to start.