Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Aranya 2008
Co-Sponsored by ISTE
IKNIGHT CODERS
PRELIMNARY ROUND
Team Name:_____________________________
Members Details:
Rules:
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:
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
#include<stdio.h>
#include<conio.h>
int main()
{
printf("%c","abcdef"[4]);
getch();
}
a) Compilation Error d) f
b) a e) Other:________________________ ______
c) e
#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) 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
(a) -6 (d) 2
(b) 6 (e) Other:_____________________________________________________
(c) 4
#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
Q10) Each side of a rectangle is increased by 100% .By what percentage does the area increase?
#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
#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
Co-Sponsored by ISTE
#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();
a) Aranya d) Aranya\08
c) Runtime Error
iKnight Coders 7
Aranya 2008
Co-Sponsored by ISTE
#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
#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?
Co-Sponsored by ISTE
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
#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
#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
(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
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
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)
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
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)
14-c(blarne stroustrap)
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)
21-c(continue)
23-e(15/60=1/4)
24-e-depends on value of x
26-c??
27-d(16+9+4+ 1=30)
28-b(1)
30-d(0)
32-d(11/110=.1)