NEW
Font size
WorksheetsC Revision Test Basic To Structure
Total questions: 57
Worksheet time: 57mins
Which of the following are themselves a collection of different data types?
String
Struct
char
all
Which operator connects the structure name to its member name?
-
=
.
>>
Which of the following cannot be a structure member?
another structure
array
Function
None
What do you understand by:
void update(struct student *s);
update is a function that takes an argument as pointer to structure variable and returns nothing
update is a method that takes structure type variable as parameter
Error, we cannot pass structure variable as pointer to a function
update takes pointer argument but it cannot return void
_______________to be included to use standard I/O functions : prinf(),scanf()
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
Blank spaces can be used while declaring a variable, keyword, constant and function.
True
False
The user can also write one or more statements in one line by separating semicolon (;)
True
False
The opening and closing braces should be balanced.
True
False
A variable is an entity whose value ____________ during the execution of a program
can change
cannot change
Which is correct example for variable declaration?
int a;b;c;
Int a,b,c;
int a,b,c;
int a,b;c;
What are the Relational operators?
<< , >>
+, -, !, ~, ++, - -, &, sizeof
*, /, %
<, <=, >, >=
The sizeof operator returns the size of its operand in bytes
True
False
Address-of Operator is used to find the address of a data object. Example: &a
True
False
How many main() function we can have in a program
1
2
No Limit
None
How many loop are there in C
2
3
1
4
Library function getch() belongs to which header file?
stdio.h
conio.h
stdlib.h
none
What are Parameter passing techniques available in C Language
Call by value
Call by reference
Both
None
Array is collection of elements of
Dis-similarity Data Types
Similar Data Types
Both
None
what are the basic data types in C Language
int , float
int , float , char
int, float, char , double
int, char, double
Arithmetic operators available in C Language are
+ , -, *, / , %
+ , -, *, / , <
+ , -, *, ==, <=
&&, ||, ==, >=
Pointer variable is to hold
int value
float value
Address
None
Conditional statements are
Simple if , if-else , else-if, switch
Simple if , if-else , else-if, while
Simple if , do-while , else-if, switch
Simple if , if-else , do-while , for
Program execution starts from
#include
main()
Other sub-functions
None
Conditional operator (? :) is a
Unary Operator
Binary Operator
Ternary Operator
All
Examples for Unary operators
% , /
==, &&
<= , >=
++ , --
What is output for:
a=5;
printf("%d", a++) ;
5
6
4
0
What is the Output:
int a=5;
printf("%d", ++a);
5
6
7
4
What is the output:
int i;
printf("%d", i);
0
Garbage value
1
Error
What is the Output :
void main()
{
int a=5,b=6,k;
k=b>a?b:a;
printf("%d",k);
}
5
6
11
Error
what is the output:
void main()
{
int a=5;
a+=2;
printf("%d",a);
}
7
5
6
Error
What is the Output:
void main()
{
int a=4, b=2,c;
c=a*b;
printf("%d%d%d",b,c,a);
}
4, 2, 8
2, 4, 8
4, 8, 2
2, 8, 4
what is the Output:
void main()
{
int a=3,b=6;
if(a>b)
printf("%d",a);
else
printf("%d",b);
}
3
6
Compilation Error
Run Time Error
What is the technique name for the following Function call swap():
void main()
{
swap(3,7)
}
Call by value
Call by reference
Both
None
What is the Keyword used to define a Structure
Structure
Static
Dynamic
Struct
"goto" statement is:
Conditional statement
Assignment statement
Declaration statement
Unconditional statement
Which of the following is a Unary Operator
&&
||
<
!
Structure mean ------------?
Same data types
Different data types
Both a and b
None of these
4. Name the one which is not a looping statement
for
while
do-while
if
Constant is ------------------
Fixed values
Unknown values
Values changes during execution
None of these
Every C statement ends with ------------?
.
;
,
}
----------------- are used in C programming to manipulate the data at bit level
Logical operator
Bitwise operator
Additional operators
None of the above
In switch statement Case Labels must ends with --------
;
:
,
}
while loop is a --------------------------- loop.
Entry-controlled
Exit-controlled
Not controlled
None of these
do-while loop performs the test at the ------------- of the loop
top
bottom
middle
None of these
---------- and ------------ are the two frequent operations on arrays.
Searching and sorting
Decrementing and decrementing
Searching and incrementing
none of these
We can initialize a two-dimensional array in the form of ---------
Searching
increment
matrix
none of these
The two dimensional array is
int
struct
matrix
none of these
Structure keyword is -------------
struct
array
main
none of these
A sequence of instructions form a ------------.
syntax
program
both
none of these
The continue statment cannot be used with
for
while
do while
switch
goto can be used to jump from main to within a function?
true
false
-
-
Which loop is guaranteed to execute at least one time.
for
while
do while
none of the above
What will be the output of the following C code?
#include <stdio.h>
int main()
{
do{
printf("In while loop ");
}while (0);
printf("After loop\n");
}
In while loop
In while loop after loop
After loop
Infinite loop
#include <stdio.h>
int main()
{
int i = 0;
do {
i++;
printf("in while loop\n");
} while (i < 3);
}
2
3
4
1
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 0;
do
{
printf("Hello");
} while (i != 0);
}
Nothing
H is printed infinite times
Hello
Run time error
#include<stdio.h>
int main()
{
int i;
for(i=0;i<10;i++);
printf("%d ",i);
}
0 1 2 3 4 5 6 7 8 9
Compile Error
Run Time Error
10
Is it possible to run program without main() function?
yes
no
-
-
