Reverse Gear 1 Aranya 2008
REVERSE GEAR P R E L I M N A RY R O U N D
Team Name:_____________________________
Members Details: Member 1: Name:____________________ _________
Member 2: Name:____________________ _________
Member 3: Name:____________________ _________
College:__________________ _________
College:__________________ _________
College:__________________ _________
Contact No.:___________________
Contact No.:___________________
Contact No.:______________________
email address:_________________
email address:_________________
email address:__________________ _
Rules:
1. When question does not mention compiler take default as G++/GCC. 2. Marking Scheme: +4 -1 3. Cutting, erasing, Overwriting of answers will count as a wrong answer and you will be rewarded -1 for it. 4. 10 teams have already earned a place into the finals via iReverse Gear. 5. The prelims will select the remaining 30 teams that enter the mains round and battle out for the prize. 6. Decision of the organizers shall be final in all cases.
Reverse Gear 2 Aranya 2008 1. Q1. Which of the following gives odd no. if m is any whole no?
a) m2 b) m2+m+1 c) 3m+2
d) m3 None of the above
Q2. What is the output of the following program?
#include<stdio.h> #include int main() { int k = 5; if (++k < 5 && k++/5 || ++k <= 8); printf("%d\n", k); } a) 5 b) 6 c) 7
d) 8 e) Other:________________________ ______
Q3) Consider the following program(say x,y&z are some numbers) ?
#include<stdio.h> #include int main()
Reverse Gear 3 Aranya 2008
{ // For Dev C++ int a=x,b=y,c=z; if (a>b) if(b>c) s1; else s2; getch(); } Statement s2 will be executed if a) a<= b b) b>c c) b<=c and a>=b
d) Compilation error e) Other:_______________________
Q4) Given that a,b,c,d,e each represent one of the digits between 1-9 and that the following multiplication holds
abcde * 4 (Multiply by 4) ---------edcba What digit can e represent
(a) 4 (b) 6 (c) 7
(d) 8 (e) None of the above is possible.
Q5) The expression, int a = 30 * 1000 + 2768 ; evaluates to
Reverse Gear 4 Aranya 2008 (a) 32768 (b) -32768 (c) 113040
(d) 0 (e) Other:_______________
Q6) In C the expression printf("%d", sizeof("")); prints: (a) (b) (c) (d)
1 2 0 Execution Error
(e) Other:________________________________________________ _____
Q7) What is the output of the following program, if it is compiled and executed without any command line arguments?
#include<stdio.h> #include int main(int argc,char argv[]) { printf("%d",argc); } a) 0 b) 1 c) 2 d) Garbage Value
e) Other:________________________________________________ ___________
Q8) What will be the output of the following code, given input 5, 6?
#include #include<stdio.h> int main() {
Reverse Gear 5 Aranya 2008
int a,b; printf("enter two numbers :"); scanf("%d%d",a,b); printf("%d+%d=%d",a,b,’a’+b); } A) 5+6=5 B) 5+6=50 C) 5+6=11
D) 5+6=71 E) None of the Above
Q9) Which of the following are valid declaration of an array in C? I: int a[][] II: int a[4][] III: int a[4][4] (a) III only (b) II and III only (c) II III and Iv
IV: int a[][4]
(d) III and IV (e) Other __________________________
In a survey of 100 students studying various subjects(History, English, Science) are as follow, 18 of them study only English, 23 studies English but not History, 26 studies English,48 studies science,8 studies both science and history while 2 don’t study any language. Find how many students are studying Q10) History (a) 8 (b) 26 (c) 18 Q11) both English and History (a) 23 (b) 3 (c) 26 Q12) Studying Hindi (a)23
(d)20 (e) Other:________________________
(d)18 (e) Other:_________________________
(b) 3
Reverse Gear 6 Aranya 2008 (c) 26 (d)18
(e) Other:_________________________
Q13) Which of the following is allowed in a C Arithmetic instruction (a) [ ] (b) { } (c) ( )
(d) Both b & c (e) None of the above
Q14) What will be output of the following program?
#include #include<stdio.h> int main() { printf("%d %d",7); } a) b) c)
7 garbage_value 70 Compilation Error
d) 7 e) Other:______________________________________________
Q15) What is the output of the following section of code ?
#include #include<stdio.h> int main() { int a, b, c, abc = 0; a = b = c = 40;
Reverse Gear 7 Aranya 2008
if (c) { int abc; abc = a*b+c; } printf ("c = %d, abc = %d\n", c, abc); } a) Compilation Error b) Runtime Error c) c = 40, abc = 1640
d) c = 40, abc = 0 e) Other _________________________________
Q 16) Fill in the blank:- o, t, t, f, f, s, s, _, n, t….. e) e f) n g) t
h) k
none of these
Q17) What will be the output of the following code ?
#include #include<stdio.h> int main() { int a=1;
+
+
a = a + + + + + + + + + + + + + - +a; printf ("a=%d\n",a);
+
+
+
+
+
+
+
+
+
Reverse Gear 8 Aranya 2008
} a) 2 b) Compilation Error c) execution Error d) 0
e) Other _______________ __________________________________
Q18) What will be the output of the following code ?
#include #include<stdio.h> int main() { int a=50; a=a++; a=++a; printf(“%d”,a);
} a) 52 b) 41 c) 51
d) 50 e) Other ______________________________________________
Q19) What will be the output of the following code ?
#include #include<stdio.h> int main()
Reverse Gear 9 Aranya 2008
{ char *p=""s"Hello"; printf("%s",p); } (a) sHello (b) s (c) Hello
(d) Compilation error (e)Other:______________________________ ___
Q20) What will be the output of the following file(try.c) ?
#include<stdio.h> #include int main() { int new=32767; new = new/-32768; printf("%d",new); } (a) 0 (b) 1 (c)-1
(d)Compilation Error (e)Other:_____________________________________________ ____
Q21) Which of the following statement can be used to terminate the program at s?
#include<stdio.h> #include
Reverse Gear 10 Aranya 2008
int main() { int new=32767; s; new = new/-32768; printf("%d",new); } (a) return 0 (b) break (c) continue
(d)end (e) None of the above
Q 22. What will be the next entry in the second row? There might be more than 1 entries in 1st and 3rd rows before that. AEFHIK BDGJ C a) L b) M c) N Q23) If
Find 444 +444 -------a) 1330 b)1332 c) 1443
d) P e) None of these
222 +222 ---------1221
and
111 +111 -----------1110
d)1333 e) None of these
Reverse Gear 11 Aranya 2008
Q24) Find the output of the following piece of code.
#include #include<stdio.h> int main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } (a) 5 0 1 (b) Compilation Error (c) 5 7 3
(d) 5 10 2 (e) Other:______________________
Q25) What will be the output of the following code ?
#include #include #include<stdio.h> int main() { printf("%c",'d'+9);
Reverse Gear 12 Aranya 2008
} a) d b) m c) 9
d) Compilation error e) Other: ________________________________
Q26) What will be the output of the following code if the keyboard input is 123456789?
#include<stdio.h> #include int main() { int i=7; printf("%d",scanf("%d",&i)); } (a) 9 (b) Compilation Error (c) Garbage Value
(d) 1 (e) Other:_____________________________________
Q27) How many digits of the decimal no. system are there such that they do not come in as unit’s place of any perfect square less than 499? (a) 4 (b) 3 (c) 2
(d) 0 (e)Other:_________________________
Reverse Gear 13 Aranya 2008
Q28) B is 6km East of A. C is 8km North of B. D is 12km East of C. E is 16km North of D.What is the distance b/w A and E? (a) 20km (b) 22km (c) 18km
(d) 30km (e) Other:________________
Q29) What is the output of the following program? #include #include<stdio.h> int main() { int a[]={5,4,3,2,1}; int x,y; int *p=&a[2]; *p++; x=++*p; y=*(p++); printf("%d %d",x,y); }
(a) 3 2 (b)4 3
(c)3 4 (d)3 3
Reverse Gear 14 Aranya 2008 (e)Other:______________________________ ____________
Q30) What will be the maximum area of a quadrilateral having perimeter of 20m? (a) 100m2 (b) Can’t be determined. (c) 25m2 (d) 24 m2 (e) Other:_____________