Está en la página 1de 11

iKnight Coders 1

Aranya 2008

Co-Sponsored by ISTE

IKNIGHT CODERS
PRELIMNARY ROUND

Team Name:_____________________________

Members Details:

Member 1: Member 2: Member 3:


Name:_____________________________ Name:_____________________________ Name:_____________________________

Year:______________________________ Year:______________________________ Year:______________________________

Roll No.:________________________ Roll No.:_________________________ Roll No.:__________________________

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. Top 30 teams from this round will be selected in the finals

Prizes:

1. The top 10 teams (of finals) will get a direct wildcard entry in Aranya 2008, Knight
Coders.
2. First Prize: Rs 3000/-
3. Second Prize: Rs 2000/-
4. Maximum Score in Prelims: Rs 750/-
5. Fastest Mains correct submission: Rs 250/-
iKnight Coders 2
Aranya 2008

Co-Sponsored
Sponsored by ISTE

Q 1.Here
.Here is a picture of two cubes:

i. The two cubes are exactly alike.


ii. The hidden faces indicated by the dots have the same alphabet on them.

Which alphabet-q,
q, r, w, or k is on the faces indicated by the dots?

a) q d) k
b) r e) Other:______________________________
______
c) w

Q2.. What is the output of the following program?

#include<stdio.h>
#include<conio.h>
int main()
{
printf("%c","abcdef"[4]);
getch();
}
a) Compilation Error d) f
b) a e) Other:________________________ ______
c) e

Q3) What is the output of the following program?

#include<stdio.h>
#include<conio.h>
//Compiled in Turbo C++
int main()
{
int p=400001;
printf("%d",p);
iKnight Coders 3
Aranya 2008

Co-Sponsored by ISTE

}
a) 40000 d) Compilation error
b) 1 e) Other:_______________________-
c) 0

Q4) What is the smallest integral value of x for which y>100 in the equation: 4y-3x=5?

(a) 395/3 (d) 134


(b) 133 (e) Other:___________________________
(c) 131

Q5) Which of the following is FALSE in C ?

(a) Keywords cannot be used as variable names (d) Capital letters can be
(b) Variable names can contain a digit at any position used in variable names
(c) Variable names do not contain a blank space (e) All are true

Q6) In C the expression x = 4 + 2 % - 8 evaluates to

(a) -6 (d) 2
(b) 6 (e) Other:_____________________________________________________
(c) 4

Q7) What is the output of the following program?

#include<iostream> //For DevC++


using namespace std;
int main()
{
cout<<”Namaste Hello Bonjour”;
return 0;
}

a) Namaste d) Namaste hello Bonjour


b) Hello e) Other:___________________________________________________________
c) Bonjour

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

#include<conio.h>
iKnight Coders 4
Aranya 2008

Co-Sponsored by ISTE

#include<stdio.h>
#include<iostream>
using namespace std; //For Dev CPP
int main()
{
cout<<(92 | 23);
getch();
return 0;

}
A) 95 D) 1
B) 92 E) Other _________________________________________________________
C) 0

Q9) Which of the following fractions is less than 1/3?

(a) 22/62 (d) 1


(b) 15/46 (e) 83/256
(c) 2/3

Q10) Each side of a rectangle is increased by 100% .By what percentage does the area increase?

(a) 100% (d) 50%


(b) 200% (e) Other:____________________________________
(c) 300%

Q11) The following operations are performed on a and b:


i. int b is assigned minimum integer value
ii. int a=-b
iii. print a and b
What will be output?

(a) Two negative numbers with same value.


(b) One positive number and one negative number with same magnitude.
(c) Two negative numbers with different value.
(d) One positive number and one negative number with different magnitude.
(e) Other________________________________________________________________________

Q12) What will be output of the following program?

#include<stdio.h>
int main()
iKnight Coders 5
Aranya 2008

Co-Sponsored by ISTE

{
int arr[5]={2, 3};
printf("%d%d%d", arr[2], arr[3], arr[5]);
}

a) 0, 0, 0 d) 2, 3, 5
b) garbage values e) Other:______________________________________________
c) error

Q 13) If a is an integer variable, a = 5 / 2 ; will return a value

(a) 2.5 (d) 0


(b) 3 (e) Other:________________________________________________
(c) 2

Q14) C++ language has been developed by

(a) Ken Thompson (d) Martin Richards


(b) Dennis Ritchie (e) Other:________________________________________________
(c) BJarne Stroustrup

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

#include<iostream>
#include<conio.h>
using namespace std; //For Dev CPP

int main()
{
int i=1;
while(i++==9)
cout<<i;
getch();

}
a) 2 d) 10
b) 9 e) Other _________________________________
c) No Output

Q16: In b = 6.6 / a + 2 * n ; which operation will be performed first?


iKnight Coders 6
Aranya 2008

Co-Sponsored by ISTE

(a) 6.6 / a (d) b=6.6


(b) a + 2 (e) Other:__________________________________________
(c) 2 * n
Q17. What will be the output of the following code ?

#include<conio.h>
#include<stdio.h>
#include<iostream> //for Dev CPP
using namespace std;
int main()
{
printf("%d", printf("%d",34));
getch();

a) 34 d) 342
b) Compilation Error e) Other _______________ __________________________________
c) garbage_value 34
Q18) What will be the output of the following code ?

#include<conio.h>
#include<stdio.h>
#include<iostream > //For Dev CPP
using namespace std;
int main()
{
char a[25];
scanf("%s",a);
cout<<a;
getch();

The input string is : "Aranya\08"

a) Aranya d) Aranya\08

b) Compilation Error e) Other ______________________________________________

c) Runtime Error
iKnight Coders 7
Aranya 2008

Co-Sponsored by ISTE

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

#include<conio.h>
#include<stdio.h>
int main( )
{
int i = 4, z = 12 ;
if ( i = 5 || z > 50 )
printf ( "This Knight is going to be fun" ) ;
else
if (i == 4 && z-=12) printf(“Best Knight ever”);
else printf(“I am going to sleep”);
return 0;
}
(a) This Knight is going to be fun (d) Compilation eror:_______________________
(b) Best Knight ever (e)Other:_________________________________
(c) I am going to sleep

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

#include<stdio.h>
#define ABC 20
#define XYZ 10
#define XXX ABC - XYZ
void main()
{
int a;
a = XXX * 10;
printf("%d ", a);
}
(a) -100 (d)Error:_________________________________________________
(b) -80 (e)Other:_________________________________________________
(c)100

Q21) Which of the following statement is used to take the control to the beginning of the loop?

(a) exit (c) continue


(b) break (d)None of the above

Q22) if x satisfies eqn: x(x-2)=0


iKnight Coders 8
Aranya 2008

Co-Sponsored by ISTE

Find real values of x^x^x-x^x?


(a) 0,12 (d) 0,4
(b) 1,12 (e)Other:__________________________________________
(c) 12 only

Q23) A person was fined for exceeding the speed limit by 10mph. Another person was also fined for
exceeding the same speed limit by twice the same. If the second person was traveling at a speed of
35 mph, find the speed limit mps.
(a) 900 (d)5/12
(b)15 (e)Other:__________________________________________________
(c)2/5

Q24) If the value of x is real which of the following is the largest?

(a) x (d) 1/x


(b) x2 (e) other:
(c) -x ___________________________

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

#include<conio.h>
#include<stdio.h>
#include<iostream> //For Dev CPP
using namespace std;
int main()
{
int a=5;
printf("%d %d ",a++ , ++a );
getch();
}
a) 5 6 d) 5 7
b) 6 6 e) Other: ________________________________
c) 5 5

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

#include<conio.h>
#include<stdio.h>
#include<iostream> //For Dev CPP
using namespace std;
int main()
{
iKnight Coders 9
Aranya 2008

Co-Sponsored by ISTE

int a=5;
printf("%d", a++ + ++a + a);
getch();
}
(a) 17 (d) 20
(b) 16 (e) Other:_____________________________________
(c) 18

Q27) There are five parallel horizontal lines and five parallel vertical lines each. Count the
number of possible squares in it, considering, they cut each other at equal distance.

(a) 16 (d) 30
(b) 21 (e)Other:_____________________________
(c) 55

Q28) A cubical box painted from all sides. Side 1: Blue, Side 2: Cyan, Side 3:Red, Side 4:Black,
Side 5:Pink, Side 6:Green. It is cut at two places along the length, breadth and height each.
Calculate how many pieces are left uncoloured?

(a) 8 (d) 4
(b) 1 (e) Other:_______________________________
(c) 2

Q29) 11,24,39,___,525,636. Find the missing number?


(a) 416 (d) 55
(b) 272 (e)Other:______________________
(c) 100
Q30) Square has four edges and two of its diagonals pass through its center. A Regular heptagon
has seven sides. How many of its diagonals pass through its center?

(a) 1 (d) 0
(b) 7 (e) Other:___________________
(c) 14
iKnight Coders 10
Aranya 2008

Co-Sponsored
Sponsored by ISTE

Q31) Which of the following figures could be made by combining the the two figures A &B.

Figure A Figure B

(a) (b) (c) (d)

(e) None of the above

Q32) In a box containing hundred and ten balls, twenty are red, nineteen are black, twenty are
green, seventeen are blue, twelve are pink, eleven are orange and rest are white. I pick up a ball
at random. What is the probability of getting a white ball?

(a) 11 (d) .1
(b) .21 (e) Other:________________________
(c) .11

ANSWERS, HINTS, SOLUTIONS:

1-a(that
a(that is only possible case as we rotate 180 degree hori and 90 verti)(this question was given
free to all due to lack of readability in the figure)

2-c(it
c(it treats the chars like a array)

3-e-(400001
(400001 is out of range so it wil convert it)

4-e-132(simple eqn solving)

5-b

6-b(1st 2% of -8=2
8=2 than +4 to it therefore 6)
iKnight Coders 11
Aranya 2008

Co-Sponsored by ISTE

7-e-Namaste Hello Bonjour(plz see h is capital in question)

8-a(1 bit oring is taking place among binary no's)

Ans9: (b) and (e) both are correct (Marks were alloted for even one correct answer)

Ans10 c(400%-100%=300%)

11-a(- of minimum -ve no i.e -32768 will be 32768 out of range so again cycle starts from -32768)

12-ans: b(garbage values)

13-c(int by int gives int)

14-c(blarne stroustrap)

15-c(loop will not run)

16-a(left to right wen precedence equal)

17-d(first inner printf will run and 2 will be printed as printf returns no of chars it prints therefore
342 will be printed)

18-d(string dont need &)

19-a(its i=5 not i==5)

20-b(as define straightaway pastes value)

21-c(continue)

22-c(two cube - two square=12 and o raise to power 0 nt defined)

23-e(15/60=1/4)

24-e-depends on value of x

25-b(commas treated right to left)

26-c??

27-d(16+9+4+ 1=30)

28-b(1)

29-a(416 1st no is int next two are its square)

30-d(0)

31-c(by rotating 2 nd one)

32-d(11/110=.1)

También podría gustarte