C questions--done - C Test PAPER - 1 1) int prime[7]= {2, 3...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: C Test PAPER - 1 1) int prime[7]= {2, 3 ,5, 7, 11, 13}; The size of the array prime assuming int variables to occupy 2 bytes is a) 14 b) 12 c) 6 d) None of these 2) a = 100; b = 5; c = a << b << 3; Assuming the type of all variables to be int the value stored in c is a) 7 b) 25600 c) 5 d) 12800 3) The output of the program: #include <stdio.h> int e=4; struct x {int a; int b;}; struct x c = {3,4}; struct x d = {5,6}; void main(){ c.a = c.b + d.a; e = d.a + c.b; printf("%d\n",e);} a) 9 b) 13 c) 10 d) 8 4) The output of the program : #include <stdio.h> void main(){ int a=1, b=2, c=3; a = b << c; printf("%d\n",a);} a) 16 b) 32 c) 8 d) 2 Q 5 Q7 3 5 7 1 2 9 6 4 8 5) The counter-postfix notation is a) 4972683051 b) 3794268501 c) 1058624973 d) 3510726894 6) The infix notation a) 3510726894 b) 1503862794 c) 3571029648 d) None of these 7) The corresponding binary search tree in infix notation is a) Binary search tree cannot be created as the elements are not sorted when traversed in any order. b) 0123456789 c) 1503862794 d) None of these 8)Given the following declaration; FILE *ifp; Which of the following would not open the file input.dat for input in text mode? a) ifp = fopen (input.dat, r); b) ifp = fopen (input.dat, r+); c) ifp = fopen (input.dat, rb); d) ifp = fopen (input.dat, rt); Q9 Q12 typedef union ut { int I; float f; char s [20]; }; ut u, *pu, au [5]; (Assume that an int is '2 bytes', float is '4 bytes', char is '1 byte' and pointer is...
View Full Document

This note was uploaded on 06/08/2010 for the course IIM CAT taught by Professor Cat during the Spring '06 term at Indian Institute Of Management, Ahmedabad.

Page1 / 12

C questions--done - C Test PAPER - 1 1) int prime[7]= {2, 3...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online