Sie sind auf Seite 1von 14

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: Member 2: Member 3:


Name:____________________ Name:____________________ Name:____________________
_________ _________ _________

College:__________________ College:__________________ College:__________________


_________ _________ _________

Contact Contact Contact


No.:___________________ No.:___________________ No.:______________________

email email email


address:_________________ address:_________________ 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 d) m3
b) m2+m+1
c) 3m+2 None of the above

Q2. What is the output of the following program?

#include<stdio.h>

#include<conio.h>

int main()

int k = 5;

if (++k < 5 && k++/5 || ++k <= 8);

printf("%d\n", k);

a) 5 d) 8
b) 6 e) Other:________________________ ______
c) 7

Q3) Consider the following program(say x,y&z are some numbers) ?

#include<stdio.h>

#include<conio.h>

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 d) Compilation error


b) b>c e) Other:_______________________
c) b<=c and a>=b

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 (d) 8
(b) 6 (e) None of the above is possible.
(c) 7

Q5) The expression, int a = 30 * 1000 + 2768 ; evaluates to


Reverse Gear 4
Aranya 2008

(a) 32768 (d) 0


(b) -32768 (e)
(c) 113040 Other:_______________

Q6) In C the expression printf("%d", sizeof("")); prints:

(a) 1 (e)
(b) 2 Other:________________________________________________
(c) 0 _____
(d) Execution Error

Q7) What is the output of the following program, if it is compiled and executed
without any command line arguments?

#include<stdio.h>

#include<conio.h>

int main(int argc,char argv[])

printf("%d",argc);

}
a) 0 e)
b) 1 Other:________________________________________________
c) 2 ___________
d) Garbage Value

Q8) What will be the output of the following code, given input 5, 6?

#include<conio.h>

#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 D) 5+6=71
B) 5+6=50 E) None of the Above
C) 5+6=11

Q9) Which of the following are valid declaration of an array in C?

I: int a[][] IV: int a[][4]


II: int a[4][]
III: int a[4][4]

(a) III only (d) III and IV


(b) II and III only (e) Other __________________________
(c) II III and Iv

<For Questions 10-12> 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 (d)20
(b) 26 (e) Other:________________________
(c) 18

Q11) both English and History


(a) 23 (d)18
(b) 3 (e) Other:_________________________
(c) 26

Q12) Studying Hindi


(a)23 (b) 3
Reverse Gear 6
Aranya 2008

(c) 26 (e) Other:_________________________


(d)18

Q13) Which of the following is allowed in a C Arithmetic instruction


(a) [ ] (d) Both b & c
(b) { } (e) None of the above
(c) ( )

Q14) What will be output of the following program?

#include<conio.h>

#include<stdio.h>

int main()

printf("%d %d",7);

}
a) 7 garbage_value d) 7
b) 70 e)
c) Compilation Error Other:______________________________________________

Q15) What is the output of the following section of code ?

#include<conio.h>

#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 d) c = 40, abc = 0
b) Runtime Error e) Other _________________________________
c) c = 40, abc = 1640

Q 16) Fill in the blank:- o, t, t, f, f, s, s, _, n, t…..

e) e h) k
f) n
g) t none of these

Q17) What will be the output of the following code ?

#include<conio.h>

#include<stdio.h>

int main()

int a=1;

a = a + + + + + + + + + + + + + + + +
+ + + + + + + + - +a;

printf ("a=%d\n",a);
Reverse Gear 8
Aranya 2008

}
a) 2 e) Other _______________
b) Compilation Error __________________________________
c) execution Error
d) 0

Q18) What will be the output of the following code ?

#include<conio.h>

#include<stdio.h>

int main()

int a=50;

a=a++;

a=++a;

printf(“%d”,a);

}
a) 52 d) 50
b) 41 e) Other
c) 51 ______________________________________________

Q19) What will be the output of the following code ?

#include<conio.h>

#include<stdio.h>

int main()
Reverse Gear 9
Aranya 2008

char *p=""s"Hello";

printf("%s",p);

}
(a) sHello (d) Compilation error
(b) s (e)Other:______________________________
(c) Hello ___

Q20) What will be the output of the following file(try.c) ?

#include<stdio.h>

#include<conio.h>

int main()

int new=32767;

new = new/-32768;

printf("%d",new);

}
(a) 0 (d)Compilation Error
(b) 1 (e)Other:_____________________________________________
(c)-1 ____

Q21) Which of the following statement can be used to terminate the program at s?

#include<stdio.h>

#include<conio.h>
Reverse Gear 10
Aranya 2008

int main()

int new=32767;

s;

new = new/-32768;

printf("%d",new);

}
(a) return 0 (d)end
(b) break (e) None of the above
(c) continue

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

a) L d) P
b) M e) None of these
c) N

Q23) If 222 and 111


+222 +111
---------- ------------
1221 1110

Find
444
+444
--------
a) 1330 d)1333
b)1332 e) None of these
c) 1443
Reverse Gear 11
Aranya 2008

Q24) Find the output of the following piece of code.

#include<conio.h>

#include<stdio.h>

int main()

int x=5;

printf("%d %d %d\n",x,x<<2,x>>2);

(a) 5 0 1 (d) 5 10 2
(b) Compilation Error (e) Other:______________________
(c) 5 7 3

Q25) What will be the output of the following code ?

#include<iostream>

#include<conio.h>

#include<stdio.h>

int main()

printf("%c",'d'+9);
Reverse Gear 12
Aranya 2008

}
a) d d) Compilation error
b) m e) Other: ________________________________
c) 9

Q26) What will be the output of the following code if the keyboard input is
123456789?

#include<stdio.h>

#include<conio.h>

int main()

int i=7;

printf("%d",scanf("%d",&i));

(a) 9 (d) 1
(b) Compilation Error (e) Other:_____________________________________
(c) Garbage Value

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 (d) 0
(b) 3 (e)Other:_________________________
(c) 2
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 (d) 30km


(b) 22km (e) Other:________________
(c) 18km

Q29) What is the output of the following program?

#include<conio.h>

#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 (c)3 4
(b)4 3 (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:_____________

Das könnte Ihnen auch gefallen