Site hosted by Angelfire.com: Build your free website today!
THIS IS THE PAPER IN IIT KHARAGPUR
	DESHAW 97
PART 1						TIME:20 MIN
* 20 QUESTIONS , EACH QUESTION CARRIES 2 MARKS
1. A SOLID ICE OF 11 X 8 X2 INCHES IS MADE INTO ROD OF DIA  4 INCH. WHAT
IS THE LENGE OF ROD?
ANS: 3.5 INCH
2. THERE WERE 750 PEOPLE WHEN THE FIRST SONG WAS SUNG. AFTER EACH
SONG 50 PEOPLE ARE LEAVING THE HALL. HOWMANY SONGS ARE SUNG TO MAKE
THEM ZERO?
ANS:16
3. A PERSON IS CLIMBING OF 60 MTS . FOR EVERY MINUTE HE IS  CLIMBING 6 MTS
AND SLIPPING 4 MTS . AFTER HOWMANY MINUTES HE MAY REACH THE TOP?
ANS: (60-6)/2 +1  :28
4. HOWMANY ZEROS ARE THERE IN THE PRODUCT OF THE INTEGER FROM 1TO 100?
ANS: 24( NOT GIVEN)
	1 TO 10   -2  ZEROS
	21 TO 30  -3  ZEROS  : BECAUSE  25 = 5*5
					22 *5
					24 *5
5. A CAN DO WORK IN 2 HOURS B CAN DO A WORK IN 3 HOURS WHAT IS THE 
SHORTEST TIME TYEY CAN FINISH THE WORK?
ANS: 1HOUR 12 MIN.
6..SALARY IS INCREASED BY 1200 ,TAX IS DECREASED FROM 12% TO 10% BUT PAYING
SAME AMOUNT  AS TAX . WHAT IS THE PREVISIOUS SALARY?
ANS:6000
7. THE LEAST NO. WHICH IS WHEN DEVIDED BY 4,6,7  LEAVES A REMAINDER OF 2 ?
ANS: 86
8. A MAN DRIVING THE CAR AT TWICE THE SPEED OF AUTO ONEDAY HE WAS DRIVEN 
CAR FOR 10 MIN. AND CAR IS FAILED. HE LEFT THE CAR AND TOOK AUTO TO GOTO 
THE OFFICE . HE SPENT 30 MIN. IN THE AUTO. WHAT WILL BE THE TIME TAKE BY 
CAR TO GO OFFICE?
ANS:25 MIN
9. A REPORT HS 20 WHEETS, EACH OF 55 LINES AND EACH SU;CH A LINE CONSISTS
OF 65 CHARACTERS. IF THE REPORT HAS TO BE RETYPED WITH EACH SHEET HAVING 65 
LINES AND EACH LINE HAVE 75 CHARACTERS, THE PERCENTAGE OF  REDUCTION OF
NO OF SHEETS IS CLOSEST IS TO?
	
ANS: 25%
 
10. OUT OF 100 FAMILIES IN NEIGHBOUR HOOD , 55 OWN RADIO, 75 OWN T.V
AND 25 OWN VCR. ONLY 10 FAMILIES HAVE ALLOF THESE, AND EACH VCR OWNER
HAS TV . IF 25 FAMILIES HAVE THE RADIO ONLY, THE NO. OF FAMILIES HAVE
ONLY TV ARE?
ANS: 30


APTITUDE: ( QUESTIONS 16 T019)
KYA KYA IS AN ISLAND IN THE SOUTH PACIFI . THE INHABITANTS OF KYA KYA
ALWAYS ANSWER ANY QUESTION WITH TWO SENTENCES, ONE OR WHICH IS ALWAYS
TRUE AND OTHER IS ALWAYS FALSE.
1. YOU ARE WALKING ON THE ROAD AND COME TO A FORK. YOU ASK ,THE INHABITANTS
RAM.LAXMAN, AND LILA AS" WHICH ROAD WILL TAKE ME TO THE VILAGE?
RAM SAYS: I NEVER SPEAK TO STRANGERS. IAM NEW TO THIS PLACE
LAXMAN SAYS: IAM MARRIED TO.LILA. TAKE THE LEFT ROAD
LILA SAYS: IAM MARRIED TO RAM. HE IS NOT NEW TO THIS PLACE
ANS:  LEFT ROAD TAKE YU TO THE VILLAGE
2. YOU FIND THAT YOUR BOAT IS STOLLEN. U QUESTIONED THREE INHABITANTS OT 
 ISLANDS AND THEIR REPLIES ARE
JOHN   : I DIDNOT DO IT. MATHEW DIDNOT DO IT
MATHEW :  I DIDNOT DO IT. KRISHNA DIDNOT DO IT
KRISHNA: I DID NOT DO IT; I DONOT KNOW WHO DID IT
ANS: MATHEW STOLEN THE BOAT
3. YOU WANT TO SPEAK TO THE CHIEF OF VILLAGE , U ASK THREE FELLOWS AMAR
BOBBY, CHARLES AND BOBBY IS WEARING RED SHIRT
AMAR    : IAM NOT BOBBY`S SON ; THE CHIEF WEARS RED SHIRT
BOBBY   : IAM AMARS FATHER ; CHARLES IS THE CHIEF
CHARLES : THE CHIEF IS ONE AMONG US; IAM THE CHIEF
ANS: BOBBY IS THE CHIEF
4. THERE IS ONLY OPNE POLOT IN THE VILLAGE(ISLAND). YOU INTERVIEWED THREEM MAN 
KOISK ,LORRY AND MISHRA
U ALSO NOTICE THAT KOISK IS WEARING CAP.
M SAYS : LARRY IS FATHER IN THE PILOT .LARRY IS NOT THE PRIESTS SON
KOISK  : IAM THE PRIEST ON THEIS ISLAND ONLY PRISTS CAN WEAR THE CAPS
LARRY  : IAM THE PRIEST SON . KOISK IS NOT THE PREST
ANS : KOISK IS THE PILOT




THIS PAPER HAS GIVEN IN IIT DELHI , SO GO THROUGH THIS IT WILL GIVE 
ROUGH IDEA;
1.   typedef struct{
	char *;
	nodeptr next;
	} * nodeptr;
what does nodeptr stand for?
2. supposing thaty each integer occupies 4 bytes and each charactrer 
1 byte , what is the output of the following programme?
#include<stdio.h>
main()
{
 int a[] ={ 1,2,3,4,5,6,7};
char c[] = {' a','x','h','o','k'};
printf("%d\t %d ", (&a[3]-&a[0]),(&c[3]-&c[0]));
}
ans : 3  3
3. what is the output of the program?
#include<stdio.h>
main()
{
struct s1 {int i; };
struct s2 {int i; };
struct s1 st1;
struct s2 st2;
st1.i =5;
st2 = st1;
printf(" %d " , st2.i);
}
ans: nothing  (error)
expl: diff struct variables should not assigned using "=" operator.

4.what is the output of the program?
#include<stdio.h>
main()
{
int i,j;
int mat[3][3] ={1,2,3,4,5,6,7,8,9};
for (i=2;i>=0;i--)
 for ( j=2;j>=0;j--)
printf("%d" , *(*(mat+j)+i));
}
ans : 9 6 3 8 5 2 7 4 1
5.
fun(n);
}
int fun( int n)
{
int i;
for(i=0;i<=n;i++)
fun(n-i);
printf(" well done");
}
 howmany times is the printf statement executed for n=10?
ans: zero
expl: Befire reaching to printf statement it will goes to infinite loop.
6.what is the output of the program?
main()
{
struct emp{
	char emp[];
	int empno;
	float sal;
};
struct emp member = { "TIGER"};
printf(" %d %f", member.empno,member.sal);
ans: error. In struct variable emp[], we have to give array size.
 If array size given
ans is 0, 0.00

7. output of the program?
	# define infiniteloop while(1)
	main()
	{
	infiniteloop;
	printf("DONE");
}
ans: none
expl: infiniteloop in main ends with ";" . so loop will not reach end;
and the DONE also will not print.
8.  output of the program?
	
main()
{
int a=2, b=3;
printf(" %d ", a+++b);
}
ans:5
expl: here it evaluates as a++ + b. 
9. output of the program?
#define prn(a) printf("%d",a)
#define print(a,b,c) prn(a), prn(b), prn(c)
#define max(a,b)  (a<b)? b:a
main()
{
int x=1, y=2;
print(max(x++,y),x,y);
print(max(x++,y),x,y);
}
ans: 3 4 2
10. which of the following is the correct declaration for the function main() ?
ans: main( int , char *[])
11. if ptr is defined as
	int *ptr[][100];
	which of the following correctly allocates memory for ptr?
ans: ptr = (int *)(malloc(100* sizeof(int));
FEW MORE PROGRAMS HERE BUT NOT AVAILABLE:

 

 

SECTION-A

you should write the programs for the following problems in C.

1. swapping two variables x,y without using a temporary variable.
2. a program has been given asking to find the output
ans. it is algorithm for finding G.C.D
3. write a program for reversing the given string.
4. the integers from 1 to n are stored in an array in a random
fashion. but one integer is missing. write a program to find the
missing integer.
ans. idea. the sum of n natural numbers is = n(n+1)/2.
if we subtract the above sum from the sum of all the
numbers in the array , the result is nothing but the
missing number.
5. some bit type of questions has been given on pointers asking to
to find whether it is correct from syntax point of view. and if
it is correct explain what it will do.(around 15 bits).

SECTION-B

ANSWER AS MANY AS POSSIBLE.

6.& 7. two programs on pre-processor directions has been given asking
to find the output.
8. simple question given on pointer
a) kernighan & richie page no. 122
b) schaum series page no. 323
try to understand the pointer problems given here he asked to 
explain
in the interview if answer it in exam.
9. write a c program to find whether a stack is progressing in forward
or reverse direction.
10. write a c program that reverses the linked list.

GUIDELINES:
the interview is very tough he is asking to do the problems in
front of him. he is also giving some new problems to solve before 
him.
you should have a very good funda of C language.


-----------------------------------------------------------------------
P . V . THATAYYA NAIDU 
M.S ( CS) Hostel : 91-044-2351326
Research Scholar (PP: #341 Naidu)

341, BrahmaPutra Hostel Infotech Lab : 91-044-2351365
IIT MADRAS - 600036 ext:3529/3530
INDIA
EMAIL : naidu@indy.iitm.ernet.in 
naidu%bronto@iitm.ernet.in
-----------------------------------------------------------------------

 

> Deshaw99(WILCO99)


> THERE ARE THREE SECTIONS:

> SECTION A: APPITUDE TEST 20 BITS
> SECTION B: C BITS 20 BITS
> SECTION C: 1 QUESTION (NOT A BIT)
> IT IS LONG ANSWER
> THE QUESTION IS:FIND THE NEXT PERMUTATION IN
> LEXICOGRAPHIC 
> ORDER FROM THE GIVEN PERMUTATION

> NOTE: MAXIMUM QUESTIONS ARE FROM OLD QUESTION PAPERS
> SECTION A:

> 1. THERE WERE 750 PEOPLE WHEN THE FIRST SONG WAS
> SUNG. AFTER EACH
> SONG 50 PEOPLE ARE LEAVING THE HALL. HOWMANY SONGS
> ARE SUNG TO MAKE
> THEM ZERO?

> ANS:16

> SECTION B:

> 1. typedef struct{
> char *;
> nodeptr next;
> } * nodeptr;
> what does nodeptr stand for?


> 2. 2 oranges,3 bananas and 4 apples cost Rs.15 . 3
> ornages 2 bananas
> 1 apple costs Rs 10. what is the cost of 3 oranges,
> 3 bananas and 
> 3 apples ANs Rs 15.


> 3. int *x[](); means
> expl: Elments of an array can't be functions.

> 4. struct list{
> int x;
> struct list *next;
> }*head;
> the struct head.x =100
> above is correct / wrong


> expl: Before using the ptr type struct variable we
> have to give memory
> to that .
> And also when ever the struct variable is ptr then
> we access the 
> members
> by "->" operator.




> 5.o/p=?
> int i;
> i=1;
> i=i+2*i++;
> printf(%d,i);
> ans: 4

> 6. FILE *fp1,*fp2;
> fp1=fopen("one","w")
> fp2=fopen("one","w")
> fputc('A',fp1)
> fputc('B',fp2)
> fclose(fp1)
> fclose(fp2)}
> a.error b. c. d.
> ans: no error. But It will
> over writes on same 
> file.


> 7.#include<malloc.h>
> char *f()
> {char *s=malloc(8);
> strcpy(s,"goodbye")}
> main()
> {
> char *f();
> printf("%c",*f()='A');
> o/p=?


> 8) #define MAN(x,y) (x)>(y)?(x):(y)
> { int i=10;j=5;k=0;
> k= MAX(i++,++j)
> printf(%d %d %d %d,i,j,k)}
> 9) a=10;b=5; c=3;d=3;
> if(a<b)&&(c=d++)
> printf(%d %d %d %d a,b,c,d)
> else printf("%d %d %d %d a,b,c,d);

> : .............................................
> 10. what is o/p
> #include<stdarg.h>
> show(int t,va_list ptr1)
> {
> int a,x,i;
> a=va_arg(ptr1,int)
> printf("\n %d",a)
> }
> display(char)
> {int x;
> listptr;
> va_star(otr,s);
> n=va_arg(ptr,int);
> show(x,ptr);
> }
> main()
> {
> display("hello",4,12,13,14,44);
> }
> a) 13 b) 12 c) 44 d) 14
> .............................................


> 11.main()
> {
> printf("hello");
> fork();
> }


> 12.main()
> {
> int i = 10;
> printf(" %d %d %d \n", ++i, i++, ++i);
> }


> 13.#include<stdio.h>
> main()
> {
> int *p, *c, i;
> i = 5;
> p = (int*) (malloc(sizeof(i)));
> printf("\n%d",*p);
> *p = 10;
> printf("\n%d %d",i,*p);
> c = (int*) calloc(2);
> printf("\n%d\n",*c);
> }

> 14.#define MAX(x,y) (x) >(y)?(x):(y)
> main()
> {
> int i=10,j=5,k=0;
> k= MAX(i++,++j);
> printf("%d..%d..%d",i,j,k);
> }

> 15.#include <stdio.h>
> main()
> {
> enum _tag{ left=10, right, front=100, back};
> printf("left is %d, right is %d, front is
> %d, back is 
> %d",left,right,front,back);
> }

> 16.main()
> {
> int a=10,b=20;
> a>=5?b=100:b=200;
> printf("%d\n",b);
> }




> 17.#define PRINT(int) printf("int = %d ",int)
> main()
> {
> int x,y,z;
> x=03;y=02;z=01;
> PRINT(x^x);
> z<<=3;PRINT(x);
> y>>=3;PRINT(y);
> }