NEW
Font size
WorksheetsA Quiz on C Programming
Total questions: 20
Worksheet time: 22mins
What is the output of the below code?
Infinite loop
Prints "Hello" once
No output
Compiler error
How do you specify double constant 3.14 as a long double?
By using LD after 3.14
By using L after 3.14
By using DL after 3.14
By using LF after 3.14
A macro can execute faster than a function.
True
False
A pre-processor directive is a statement that begins with____
{
#
//
/*
What will be the output of the program ?
Hello
World
Hello World
WorldHello
What will be the output of the program ?
A
B
C
65
Which of the following function sets first n characters of a string to a given character?
strinit()
strnset()
strset()
strcset()
What will be the output of the program in 16 bit platform (Turbo C under DOS)?
Garbage Value
0 (Zero)
1990
No Output
The keyword used to transfer control from a function back to the calling function is
switch
go to
go back
return
How many times the program will print "GEC"?
Infinite times
32767 times
65535 times
Till stack overflows
Point out the error in the program
Missing parenthesis in return statement
The function should be defined as int f(int a, int b)
Redeclaration of a
No error
In mathematics and computer programming, which is the correct order of mathematical operators ?
Addition, Subtraction, Multiplication, Division
Division, Multiplication, Addition, Subtraction
Multiplication, Addition, Division, Subtraction
Addition, Division, Modulus, Subtraction
Which of the following is the correct order of evaluation for the below expression? z = x + y * z / 4 % 2 – 1
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
In C, if you pass an array as an argument to a function, what actually gets passed?
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
What will be the output of the program?
2, 1, 15
1, 2, 5
3, 2, 15
2, 3, 20
What will be the output of the program?
2, 3, 4, 5,
1, 3, 2, 4,
1, 2, 3, 4,
3, 2, 1, 0,
If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
.
*
&
->
Which bitwise operator is suitable for turning off a particular bit in a number?
&&
&
||
!
What is the similarity between a structure, union and enumeration?
All of them let you define new values
All of them let you define new data types
All of them let you define new pointers
All of them let you define new structures
How will you free the allocated memory?
remove(var-name);
free(var-name);
delete(var-name);
dalloc(var-name);
