1. Anjuman College of Engineering and
Technology, Sadar, Nagpur.
Computer Science and engineering
department
presents
Envisageâ13
âOver C Warâ
By, Shabina Parveen
Powerpoint Templates
Page 1
2. RULES
ïŒ Each Easy level question consists of 5
marks.
ïŒEach Medium level question consists of 10
marks
ïŒEach Hard level question consists of 15
marks
ïŒAccording to the level chosen for betting,
for each correct answer plus marks & for
each wrong answer respective marks will
be deducted from the actual score
Powerpoint Templates
Page 2
3. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 3
6. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 6
7. Question
Would the following program give a
compilation error or warning?
#include<stdio.h>
int main()
{
float I =10, *j;
void *k;
k = &I;
j = k;
printf(â%fnâ, *j);
return 0;
}
a. Yes
Powerpoint Templates b. No
Page 7
9. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 9
10. Question
Predict the output:
# define SQUARE(x) x*x;
inline float square(float y)
{
return y*y;
}
int main()
{
float a = 0.5, b = 0.5, c, d;
c= SQUARE (++a)l;
d = square (++b);
return 0;
Powerpoint Templates
} Page 10
11. Answer
Output: during preprocessing the
macro SQUARE gets expanded
into c=++x *++x;
You can notice the undesirable
side effect in this macro expansion;
the output is unpredictable
because such side effect must not
appear in inline function.
Powerpoint Templates
Page 11
12. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 12
13. Question
Which of the following
statement is true about the >>
operator?
a. It divides a positive value by a
power of two.
b. It multiplies a positive value by a
power of two.
c. It adds a positive value with a
power of two.
d. It subtracts from a positive value a
Powerpoint Templates
power of two. Page 13
14. Answer
a. It divides a positive
value by a power of
two.
Powerpoint Templates
Page 14
15. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 15
16. Question
would the following code compile?
#include<stdio.h>
int main()
{
int a = 10, *j; a. Yes
void *k; b. no
j= k = &a;
j++;
k++;
printf(â%u %un , j, kâ);
return 0;
Powerpoint Templates
} Page 16
21. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 21
22. Question
Which of the following
statement is correct?
a. Int a=64<<2;
b. Float a =6.42<<2;
c. Double a = 3.33<<2;
d. Long double a =3.67<<2;
Powerpoint Templates
Page 22
24. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 24
25. Question
Would the following program give a
compilation error or warning?
#include<stdio.h>
int main()
{
int *p1, i=25; a. Yes
void *p2; b. no
p1=&i;
p2=&i;
p1=p2;
p2=p1;
return 0;
Powerpoint Templates
Page 25
}
27. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 27
28. Question
âą In a file contains the line "I am a
boyrn" then on reading this line
into the array str using fgets().
What will str contain?
âą A. "I am a boyrn0"
âą B. "I am a boyr0"
âą C. "I am a boyn0"
âą D. "I am a boy"
Powerpoint Templates
Page 28
29. Answer
C. "I am a boyn0"
Powerpoint Templates
Page 29
30. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 30
31. Question
What would be the result of the
expression a^a?
a. 0
b. 1
c. Sum of two operands
d. Multiplication of two operands
Powerpoint Templates
Page 31
33. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 33
34. Question
Would the following program give
a compilation error or warning?
#include<stdio.h>
int main()
{
float *p1,i=25.50; a. Yes
char *p2; b. No
p1=&i;
p2=&i;
return 0;
} Powerpoint Templates
Page 34
39. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 39
40. Question
What will be the output of the code
snippet given below:
#include<stdio.h>
Void main()
{
Int a =10,b =65;
Printf(â%dâ,a<<(a&b));
}
a. 65 c. 0
d. 1 b. 10
Powerpoint Templates
Page 40
48. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 48
49. Question
Who were the two main individuals
involved in development of K&R standard
for C language?
a. Dennis Ritchie & John Von Neumann
b. Brian Kernighan & Dennis Ritchie
c. Grace Hopper & Niklaus Wirth
d. Dennis Ritchie & Bjarne Stroustroup
Powerpoint Templates
Page 49
50. Answer
Brian Kernighan and Dennis Ritchie
âą
Powerpoint Templates
Page 50
51. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 51
52. Question
Predict the output:
#include<stdio.h>
int main()
{
float a[]={13.24, 1.5, 1.5, 5.4, 3.5};
float *j, *k;
j=a;
k=a+4;
i = j*2;
k =k/2;
printf(â%f %fnâ, *j. *k);
return 0;
Powerpoint Templates
Page 52
}
57. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 57
58. Question
Which of the following utility
is used for compiling and
linking the program?
a. Make
b. Makefile
c. Compiler
d. linker
Powerpoint Templates
Page 58
60. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 60
61. Question
Would the following program give a
compilation error or warning?
#include<stdio.h>
int main()
{
char a[]=âsunstrokeâ; a. Yes
char *p = âcoldwaveâ; b. No
a = âcoldwaveâ;
p = âsunstrokeâ;
printf(â%s %snâ, a, p);
return 0;
} Powerpoint Templates
Page 61
66. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 66
67. Question
Which of the following
function is used to copy data
types other than strings from
one variable to another?
a. memcpy() c. objcpy()
b. datacpy() d. strcpy()
Powerpoint Templates
Page 67
72. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 72
73. Question
What will be the output of the
code snippet given below?
#include<stdio.h>
Void main()
{
Char ch = âAâ;
Printf(â%dâ, ch | âAâ & âZâ);
}
Powerpoint Templates
Page 73
75. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 75
76. Question
Consider the following program
segment:
int a=35;
int *b;
b= &a;
A. b contains address of an int
B. value at address contained in b is
an int.
C. b is a pointer which points in the
direction of an int.
Powerpoint Templates
D. all of the above Page 76
105. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 105
106. Question
âą In which numbering system can the
binary number 1011011111000101
be easily converted to?
A. Decimal system
B. Hexadecimal system
C. Octal system
D. No need to convert
Powerpoint Templates
Page 106
114. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 114
115. Question
âą What is the difference
between #include <>
and #include â â ?
Powerpoint Templates
Page 115
116. Answer
#include <> ---- > specifically used
for built in header file.
#include â â ----->specifically used
for user defined/created n header
files.
Powerpoint Templates
Page 116
117. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 117
118. Question
Assuming, integer is 2 byte, What
will be the output of the program?
#include<stdio.h>
int main()
{
printf("%xn", -1>>1);
return 0;
}
Powerpoint Templates
Page 118
129. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 129
130. Question
What does the following
declaration mean:
a. index of the pointer variable
b. memory location as 10
c. ptr is a pointer to an array of 10
integers
d. none of the above
Powerpoint Templates
Page 130
131. Answer
c. ptr is a pointer to an array of
10 integers
Powerpoint Templates
Page 131
132. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 132
150. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 150
151. Question
What do the functions atoi()?
A. is a macro that converts integer
to character.
B. It converts an integer to string
C. It converts a floating point
number to string
Powerpoint Templates
Page 151
152. Answer
is a macro that converts integer to
character
Powerpoint Templates
Page 152
153. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 153
154. Question
Predict the output:
void main()
{
printf("%s","c" "question" "bank");
}
A. c question bank
B. bank
C. cquestionbank
D. Compiler error
Powerpoint Templates
Page 154
162. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 162
163. Question
Give the output:
void main(){
char *str="c-pointer";
printf("%*.*s",10,7,str);
}
(a. c-pointer
b. c-pointer
c. c-point
Powerpoint Templates
Page 163
d. cpointer null null
165. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 165
166. Question
Which of the following statements are
correct about the program?
#include<stdio.h>
int main()
{
printf("%pn", main());
return 0;
}
Powerpoint Templates
Page 166
177. Categories
Easy
Medium
Hard
Powerpoint Templates
Page 177
178. Question
State true or false:
âą In place of the condition in a while
loop structure there can be any other
valid expression
Powerpoint Templates
Page 178