GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Intergraph  >  C
Next Question 
 C  |  Question 1 of 2    Print  
C Skills Written Test Questions

1. find(int x,int y)
{ return ((x<y)?0:(x-y)):}
call find(a,find(a,b)) use to find
(a) maximum of a,b
(b) minimum of a,b
(c) positive difference of a,b
(d) sum of a,b

2. integer needs 2bytes , maximum value of an unsigned integer is
(a) { 2 power 16 } -1
(b) {2 power 15}-1
(c) {2 power16}
(d) {2 power 15}

3.y is of integer type then expression
3*(y-8)/9 and (y-8)/9*3 yields same value if
(a)must yields same value
(b)must yields different value
(c)may or may not yields same value
(d) none of the above

4. 5-2-3*5-2 will give 18 if
(a)- is left associative,* has precedence over -
(b) - is right associative,* has precedence over -
(c) - is right associative,- has precedence over *
(d)- is left associative,- has precedence over *

5. printf("%f", 9/5);
prints
(a) 1.8,
(b) 1.0,
(c) 2.0,
(d) none
.
6. if (a=7)
printf(" a is 7 ");
else
printf("a is not 7");
prints
(a) a is 7,
(b) a is not 7,
(c) nothing,
(d) garbage.

7. if (a>b)
if(b>c)
s1;
else s2;
s2 will be executed if
(a) a<= b,
(b) b>c,
(c) b<=c and a<=b,
(d) a>b and b<=c.

8. main()
{
inc(); ,inc(); , inc();
}
inc()
{ static int x;
printf("%d", ++x);
}
prints
(a) 012,
(b) 123,
(c) 3 consecutive unappreciable numbers
(d) 111.

9.preprocessing is done

(a) either before or at beginning of compilation process
(b) after compilation before execution
(c) after loading
(d) none of the above.

10. printf("%d", sizeof(""));
prints
(a) error
(b)0
(c) garbage
(d) 1.

11.main()
{
int a=5,b=2;
printf("%d", a+++b);
}

(a) results in syntax,
(b) print 7,
(c) print 8,
(d) none,

12. process by which one bit pattern in to another by bit wise operation is
(a) masking,
(b) pruning,
(c) biting,
(d) chopping,

13.value of automatic variable that is declared but not initialized
will be
(a) 0,
(b) -1,
(c) unpredictable,
(d) none,

14. int v=3, *pv=&v;
printf(" %d %d ", v,*pv);
output will be
(a) error
(b) 3 address of v,
(c) 3 3
(d) none.

15. declaration
enum cities{bethlehem,jericho,nazareth=1,jerusalem}
assian value 1 to
(a) bethlehem
(b) nazareth
(c)bethlehem & nazareth
(d)jericho & nazareth

16. #include<conion.h>
#include<stdio.h>
void main()
{
char buffer[82]={80};
char *result;
printf( "input line of text, followed by carriage return :n");
result = cgets(buffer);
printf("text=%sn",result);
}
(a) printf("length=%d",buffer[1]);
(b) printf("length=%d",buffer[0]);
(c) printf("length=%d",buffer[81]);
(d) printf("length=%d",buffer[2]);

17. consider scanf and sscanf function , which is true

(a) no standard function called sscanf
(b) sscanf(s,...) is equivalent to scanf(...) except that
input charecter are taken from string s.
(c) sscanf is equivalent to scanf.
(d) none of above.

18. #include <stdio.h>
main()
{
char line[80];
scanf("%[^n]",line);
printf("%s",line);
}
what scanf do ?
(a) compilation error . Illegal format string.
(b) terminates reading input into variable line.
(c) and (d) other two options.

19. Problem was big so i couldn't remember . Simple one.

20 . ceil(-2.8) ?
(a) 0
(b) -3.0
(c) -2.0
(d) 2

21. for( p=head; p!=null; p= p -> next)
free(p);

(a) program run smooth.
(b) Compilation error.
(c) Run time error.
(d) None of above.

22. int x[3][4] ={
{1,2,3},
{4,5,6},
{7,8,9}
}
(a) x[2][1] = x[2][2] =x[2][3] = 0
(b) value in fourth column is zero
(c) value in last row is zero
(d) none of above.

24. main ()
{
printf("%u" , main());
}
(a) print garbage.
(b) Execution error
(c) printing of starting address of function main.
(d) Infinite loop.

25 . int a, *b = &a, **c =&b;
....
....
.....
a=4;
** c= 5;

(a) doesn't change value of a
(b) assign address of c to a.
(c) assign value of b to a.
(d) assign 5 to a.

28 . answer: swapping of values .

30 . i =5;
i= (++i)/(i++);
printf( "%d" , i);
prints ,
(a) 2
(b) 5
(c) 1
(d) 6




  
Total Answers and Comments: 5 Last Update: August 22, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: marutalksin
 
I didn't get some answers. but i tried to my level best.
1. c
2. a
3. b
4. d
5. d
6. a
7. d
8.
9. a
10. b
11. a
12. a
13. c
14. c
15. 
16. c
17.
18.
19.
20.
21. a
22. b
23. no question.
24. c(may be)
25. d
26, 27. no questions
28. c

Above answer was rated as good by the following members:
hemaniyo
November 08, 2005 23:28:28   #1  
srikanth        

RE: C Skills Written Test Questions
pls i wan answers for this q
 
Is this answer useful? Yes | No
October 07, 2006 22:12:25   #2  
jasy.G        

RE: C Skills Written Test Questions
This kind of practice sounds great.
 
Is this answer useful? Yes | No
March 01, 2007 00:11:00   #3  
marutalksin Member Since: February 2007   Contribution: 12    

RE: C Skills Written Test Questions
I didn't get some answers. but i tried to my level best.
1. c
2. a
3. b
4. d
5. d
6. a
7. d
8.
9. a
10. b
11. a
12. a
13. c
14. c
15.
16. c
17.
18.
19.
20.
21. a
22. b
23. no question.
24. c(may be)
25. d
26 27. no questions
28. c

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 1Overall Rating: -N/A-    
February 11, 2008 07:25:11   #4  
raj5045 Member Since: February 2008   Contribution: 2    

RE: C Skills Written Test Questions
The answers are as follows:-

1) c
2)a
3)b
4)
5)d
6)a
7)d
8)b
9)a
10)d
11)b
12)a
13)c
14)c
15)d
16)a
17)b
18)assigns only that part of input string to 'line' till n is entered
19)
20)c
21)firstly it will give compilation error as null is not defined. so if we change null to NULL then we will get runtime error.One of the right implementation is
for( p head; p! NULL; p q )
{
q p->next;
free(p);
}
22)b
23)no q
24)d
25)d
26)no q
27)no q
28)no q
29)no q
30)a

 
Is this answer useful? Yes | No
August 21, 2008 22:35:58   #5  
josethomasc Member Since: August 2008   Contribution: 1    

RE: C Skills Written Test Questions
2)(2power16)-1
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 2Overall Rating: -2    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape