ACS College of Engineering. Team Info.
Kambipura, Mysore Road Member 1:
Bangalore- 560074 Member 2:
INSTRUCTIONS:
- All questions are compulsory.
- Correct answers carries 2 Mark,
- Wrong answer carries 0 Mark and
- Unattended questions carries -0.5 Mark
Q1)What is the output of the following code snippet?
#include<stdio.h>
main(){
int const a = 5;
a++;
printf(“%d”,a);
}
A)5
B)6
C)Runtime Error
D)Compile Error
Q2)What is the output of the following program?
#include<stdio.h>
main() {
int i = 1;
while( i++<=5 )
printf("%d ",i++);
}
A)1 3 5
B)2 4
C)2 4 6
D)2
Q3)Choose the correct option in respect to the following program.
#include<stdio.h>
void f(int const i) {
i=5;
} main() {
int x = 10;
f(x);
}
I - Error in the statement ‘void f(int const i)’
II - Error in the statement i=5.
A)Statements I & II are true
B)Statements I & II are false.
C)Statement I is true
D)Statement II is true.
Q4)To print a long double value which format specifier can be used?
A) %ld
B) %lf
C) %Lf
D) %Ld
Q5) What is the size of an int data type?
A) 4 Bytes
B) 8 Bytes
C) 2 Bytes
D) Depends on the system/compile
Q6)What is the maximum number of dimensions an array in C may have?
A)Two
B)Eight
C)Twenty
D)Theoretically no limit. The only practical limits are memory size and
compilers.
Q7) Full form of grep is _________________.
A)Globally search with Regular Expressions and Print
B)Global Read Expression and Print
C)Goto Regular Expression and Print
D)None of above
Q8)In C, when getc() function returns EOF?
A. Never Returns
B. End of files is reached
C. When getc() fails to read a character
D. Both B and C
Q9)What will be the answer of the code?
int main()
{
int a=1,b=2,c=3;
printf("%d %d %d");
return 0;
}
A. 123
B. 1 2 3
C. 3 2 1
D. None of the Above
10)Macro substitution is type of_____?
A. Substitution
B. Preprocessor Directive
C. Compilation
D. None of the above
Q11)What will be the output of following program ?
1 #include <stdio.h>
2 void main()
3{
4 int x=22;
5 if(x=10)
6 printf("TRUE");
7 else
8 printf("FALSE");
9}
E. True
F. False
G. Error
H.None
Q12)What is (void*)0
A. Representation of NULL pointer
B. Representation of void pointer
C. Error
D. None of the above.
Q13)What will be the output of the C program?
#include<stdio.h>
int main()
{
int i = 0;
while(i < 3, i = 0, i < 5)
{
printf("Loop ");
i++;
}
return 0;
}
A. Loop Loop Loop Loop Loop
B. Infinite Loop
C. Loop Loop Loop
D. Prints Nothing
Q14)Which of the following initiates he sequence of events that ultimately
allow a user to login?
a. clri
b. sync
c. login
d. init
Q15)Neelam wants to share her code with a colleague, who may modify it.
Thus she wants to include the date of the program creation, the author
and other she wants to include the date of the program creation, the
author and other information with the program. What component should
she use?
A. Header Files
B. Iteration
C. Comments
D. Preprocessor Directive
16)To print a double value which format specifier can be used?
A - %ld
B - %lf
C - %Lf
D -%LF
17) All keywords in C are in?
A. Lower Case letters
B. Upper Case letters
C. Camel Case letters
D. both(a)and(b)
Q18)_______ should begin with sharp sign.
A. Function
B. Preprocessor directive
C. String function
D. Structure
Q19) What is the maximum number of dimensions an array in C may
have?
A.Two
B. Eight
C. Twenty
D. Theoretically no limit. The only practical limits are memory size and
compilers.
Q20)Which operator are known as Ternary operator?
A- ::,?
B- ?,:
C- ?,;;
D- None of the Above