WorksheetsTechnical Quiz
Total questions: 84
Worksheet time: 1hrs 6mins
Question Mark Colon Operator.?
A) Comparison Operator
B) If-Else Operator
C) Binary Operator
D) Ternary Operator
There are ___ storage classes in C
2
4
6
8
Which is the incorrect form of variable?
sale20
Name
12Rno
Net_Salary
What is the default C Storage Class for a variable?
static
auto
register
extern
To find reminder _____ operator is use in C program
%
@
/
|
Using if else statement we can check _____ condition.
1
2
3
4
Switch statement checks only _____ condition.
Equality
Not equal to
Less than
Greater than
Which one of following is not a reserved keyword in C?
auto
main
case
default
The printf() & scanf() function come from _____ header file.
conio.h
stdio.h
math.c
getio.h
Static Storage class has _____ initial value.
0
1
2
3
There are _____ keywords in C.
30
31
32
33
Which statement is incorrect about Identifier?
They can contain alphabets, digits & underscore only
The identifier is made up of 31 character.
They can use keyword.
The first character must be an alphabet & underscore.
To print multiple character _____ formatting character use.
%d
%f
%s
%c
C Language is developed at ___________?
AT & T's Bell Laboratories of USA in 1972
AT & T's Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
Which one of the following is not a valid identifier?
_examveda
1examveda
exam_veda
examveda1
Which of the following is not a correct variable type?
float
real
int
char
int main()
{
int a = 10, b = 25;
a = b++ + a++;
b = ++b + ++a;
printf("%d %d n", a, b);
}
36 64
35 62
36 63
30 28
int main ()
{
int x = 24, y = 39, z = 45;
z = x + y;
y = z - y;
x = z - y;
printf ("%d %d %d", x, y, z);
}
24 39 63
39 24 63
24 39 45
39 24 45
#include <stdio.h>
int main()
{
signed char chr;
chr = 128;
printf("%d\n", chr);
return 0;
}
128
0
-128
Garbage Value
Identify the output of the program
3, 3, 3
2, 2, 3
4, 2, 3
2, 3, 3
Which of the following is more appropriate for reading in a multi-word string?
scanf()
printf()
puts()
gets()
Find the output of the program
Compilation error
55 40 10
55 55 55
1 40 1
0 40 1
Find the output of the program
5, 3, 20
3, 3, 20
3, 2, 15
5, 2, 15
Find the output of the program
b=100 c=200
b=100 c=garbage value
b=garbage value c=200
b=300 c=200
#include<stdio.h>
int main()
{
printf("%d", -11%2);
}
1
-1
-5.5
5.5
Program is a list of_______________, written in a _______________________ to determines the behaviour of a machine.
word, english
instructions , programming language
instructions, word
A flowchart is a graphical representation that helps programmer to develop algorithms in programming.
True
False
C programming consists of two section which are _________________ and ___________________
Pre-processor directives ; Main function
Pre-processor directives ; end statement
statements ; Main function
void function () { }
function [] { }
C
NODE
PHYTON
RUBY
JAVA
PHP
JAVASCRIPT
RUBY
JAVA
JAVASCRIPT
C++
OBJECTIVE-C
JAVA
JAVASCRIPT
PHYTON
RUBY
NODE.JS
RUBY
C++
PHYTON
JAVASCRIPT
PHP
ANGULARJS
PHYTON
RUBY
C
C++
PHP
RUBY
OBJECTIVE-C
JAVA
JAVASCRIPT
C
C++
JAVA
RUBY
What will happen when the following code is executed?
void main()
{
printf("MIET");
main();
}
Wrong statement
It will keep on printing MIET
It will print MIET once
None of these
What is the result after execution of the following code if a is 10, b is 5, and c is 10?
if ((a > b) && (a <= c))
a = a + 1;
else
c = c+1;
a = 10, c = 10
a = 11, c = 10
a = 10, c = 11
a = 11, c = 11
What will be the output of the following code?
#include <stdio.h>
int main()
{
int *ptr, a = 10;
ptr = &a;
*ptr += 1;
printf("%d,%d/n", *ptr, a);
}
10, 10
10, 11
11, 10
11, 11
What will be the output of the C code?
Hello World! x;
Hello World! followed by a junk value
Compile time error
Hello World!
The format identifier ‘%i’ is also used for _____ data type.
char
int
float
double
What will be the output of the following C code?
Hi is printed 9 times
Hi is printed 8 times
Hi is printed 7 times
Hi is printed 6 times
Which of the following correctly shows the hierarchy of arithmetic operations in C?
/ + * -
* - / +
+ - / *
/ * + -
To print out 'a' as an integer and 'b' as a decimal, which of the following printf() statement will you use?
printf("%f %lf", a, b)
printf("%f %f", a, b)
printf("%d %f", a, b)
printf("%f %d", a, b)
Which picture can be best described as the principle of "algorithm"?
When was the C Language developed?
1970
1972
1975
1976
What is the result of 6%4 ?
4
3
2
1
else is a --------------------------
variable
identifier
datatype
keyword
The Unary operator is -----------------------------
>>
++
<<
==
Case label in switch() should not be -----------------------
floating point
integer
long integer
all above
Every switch() statement should have one ------------- label
default
while
for
all above
1 GB is equal to ------------
1024KB
1024 Byte
1024MB
1024 nano
No --------------- is allowed in variable
+ sign
- sign
0
Blank space
#include<stdio.h>
int main()
{
int a=2,b=7,c=10;
c=a==b;
printf("%d",c);
}
0
7
2
Compilation error
What is the output of C Program.?
int main()
{
int a=32;
do
{
printf("%d ", a);
a++;
}
while(a <= 30);
return 0;
}
32
33
30
No Output
What is the output of C Program.?
int main()
{
int a=32;
do
{
printf("%d ", a);
a++;
if(a > 35)
break;
}
while(1);
return 0;
}
No Output
32 33 34
32 33 34 35
Compiler error
What is the output of C Program.?
int main()
{
int k;
for(;;)
{
printf("TESTING\n");
break;
}
return 0;
}
No Output
TESTING
Compiler error
None of the above
What is the way to suddenly come out of or Quit any Loop in C Language.?
continue; statement
break; statement
leave; statement
quit; statement
What is the output of C Program.?
int main()
{
int a=5;
while(a=123)
{
printf("RABBIT\n");
break;
}
printf("GREEN");
return 0;
}
GREEN
RABBIT GREEN
RABBIT is printed unlimited number of times.
Compiler error.
1.Relational
2.Arithmetic
3.Logical
4.Assignment
What does the following code fragment write to the monitor?
Under
Over
Under the limit
Over the limit
Evaluate(to true or false) each of the following expressions:
(1) 14 <= 14
(2) 14 < 14
false false
true true
true false
false true
Determine the value of this expression using integer arithmetic:
5 % 7
0
2
5
Determine the value of b in this code fragment:
int a=3, b;
b=++a;
3
4
2
Determine the value of a in the second line of the code fragment:
int a=1, b=2;
a=b--;
1
0
2
C language is a
structured program
object oriented program
oriented program
basic program
a=2;b=6; (a<b):10:15
10
15
2
6
Determine the value of the expression using integer arithmetic:
6 * 9 % 3 / 2
2
0
18
What is the EXACT output from this code fragment:
int num=10;
if(num> 7 % 3 / 2 * 3)
printf("This is True");
else
printf("This is False");
This is True
This is False
How many times CppBuzz.com is printed?
int main()
{
int a = 0;
while(a++);
{
printf("CppBuzz.com");
}
return 0;
}
0 time
1 time
Compilation Error
Infinite times
How many times CppBuzz.com is printed on console?
int main()
{
int a = 0;
while(a++)
{
printf("CppBuzz.com");
}
return 0;
}
Nothing is printed on screen
0 time
1 time
Infinite times (Untill Stack overflow)
What is output of below program?
int main()
{
int i,j,count;
count=0;
for(i=0; i<5; i++);
{
for(j=0;j<5;j++);
{
count++;
}
}
printf("%d",count);
return 0;
}
55
54
1
0
