Which of the following has compilation error in C ? (A) int n = 32; (B) char ch = 65; (C) float f= (float) 3.2; (D) none of the above

2 Answers

Answer :

(D) none of the above

Answer :

D

Related questions

Description : If an integer occupies 4 bytes and a character occupies 1 byte of memory, each element of the following structure would occupy how many bytes ? struct name { int age; char name[30]; }; A) 30 B) 32 C) 34 D) 36

Last Answer : C) 34

Description : What will be the output of the following segment of the program? main( ) { char *s = “hello world”; int i = 7; printf(“%, *s”, i, s); } (A) Syntax error (B) hello w (C) hello (D) o world

Last Answer : Answer: Marks given to all

Description : What is the output of the following program ? (Assume that the appropriate pre-processor directives are included and there is no syntax error) main() { char S[ ] = "ABCDEFGH"; printf ("%C",* (& ... Base address of S is 1000 */ } (A) ABCDEFGH1000 (B) CDEFGH1000 (C) DDEFGHH1000 (D) DEFGH1000

Last Answer : (D) DEFGH1000

Description : What would happen if "String[]args" is not included as argument in the main method. A) No error B) Compilation error C) Program won't run D) Program exit

Last Answer : C) Program won't run

Description : When an array is passed as a parameter to a function which of the following statements is correct? (A) The function can change values in the original array. (B) The function cannot change values in the original array. (C) Results in compilation error. (D) Results in runtime error.

Last Answer : (A) The function can change values in the original array.

Description : When an array is passed as parameter to a function, which of the following statements is correct ? (A) The function can change values in the original array. (B) In C, parameters are passed by value, ... . (D) Results in a run time error when the function tries to access the elements in the array.

Last Answer : (A) The function can change values in the original array.

Description : What is the value returned by the function f given below when n = 100 ? int f(int n)  { if (n==0) then return n;  else return n + f(n-2);  } (A) 2550 (B) 2556 (C) 5220 (D) 5520

Last Answer : (A) 2550

Description : What does the following expression means ? char *(*(* a[N]) ( )) ( ); (A) a pointer to a function returning array of n pointers to function returning character pointers. (B) a ... to characters (D) an array of n pointers to function returning pointers to functions returning pointers to characters.

Last Answer : Answer: A,B,C,D

Description : Trace the error: void main( ) { int *b, &a; *b = 20 printf(“%d, %d”, a, *b) } (A) No error (B) Logical error (C) Syntax error (D) Semantic error

Last Answer : (C) Syntax error

Description : Assuming that the disk head is located initially at 32, find the number of disk moves required with FCFS if the disk queue of I/O block requests are 98, 37, 14, 124, 65, 67: (A) 310 (B) 324 (C) 320 (D) 321

Last Answer : (D) 321

Description : If the Disk head is located initially at track 32, find the number of disk moves required with FCFS scheduling criteria if the disk queue of I/O blocks requests are: 98, 37, 14, 124, 65, 67 (A) 320 (B) 322 (C) 321 (D) 319

Last Answer : (C) 321

Description : What are the types of casting shown by the following examples: (i) char c = (char)120; (ii) int x = ‘t’;

Last Answer : Ans. (i) Explicit casting (ii) Implicit casting

Description : Classify the following as primitive or non-primitive data types: (i) char (ii) arrays (iii) int (iv) classes

Last Answer : Ans. (i) char – Primitive (ii) arrays – Non primitive (iii) int – Primitive (iv) Classes – Non primitive

Description : Arrange the following primitive data types in an ascending order of their size: (i) char (ii) byte (iii) double (iv) int

Last Answer : Ans. The sizes of the given data types are as follows char = 2 bytes byte = 1 byte double = 8 bytes int = 4 bytes Arranging them in ascending order gives byte < char < int < double

Description : State the number of bytes occupied by char and int data types.

Last Answer : Ans. char occupies two bytes and int occupied 4 bytes.

Description : Classify the following as primitive or non-primitive data types: (i) char (ii) arrays (iii) int (iv) classes

Last Answer : Ans. (i) char – Primitive (ii) arrays – Non primitive (iii) int – Primitive (iv) Classes – Non primitive

Description : Give output for following code: class student { int roll no; char name [14]; } s[6]; void main() { cout<<sizeof(s); }

Last Answer : Considering roll_no(Single variable) the output is: 96 OR Considering roll, no (Two variables) the output is: 108 OR Considering roll no the output is: error – space between roll and no

Description : What will be the values of x, m and n after execution of the following statements? Int x, m, n; m=10; n=15; x= ++m + n++; A) x=25, m=10, n=15 B) x=27, m=10, n=15 C) x=26, m=11, n=16 D) x=27, m=11, n=16

Last Answer : C) x=26, m=11, n=16

Description : If m and n are int type variables, what will be the result of the expression m% n when m=5 and n=2 ? A) 0 B) 1 C) 2 D) None of the above

Last Answer : B) 1

Description : What is the output of the following? x = "abcdef" while i in x: print(i, end=" ") a) a b c d e f b) abcdef c) i i i i i i … d) error

Last Answer : d) error

Description : Which of the following files will displayed by this command cat *ch* A. patch B. catch C. .ch D. All of the above E. None of the above

Last Answer : D. All of the above

Description : Consider the fractional knapsack instance n = 4, (p1, p2, p3, p4) = (10, 10, 12, 18), (w1, w2, w3, w4) = (2, 4, 6, 9) and M = 15. The maximum profit is given by (Assume p and w denotes profit and weight of objects respectively) (A) 40 (B) 38 (C) 32 (D) 30

Last Answer : (B) 38

Description : What is the output when following code is executed ? >>>names = ['Amir', 'Bear', 'Charlton', 'Daman'] >>>print(names[-1][-1]) a) A b) Daman c) Error d) n

Last Answer : b) Daman

Description : A t-error correcting q-nary linear code must satisfy:  Where M is the number of code words and X is (1) qn (2) qt (3) q-n (4) q-t

Last Answer : (1) qn 

Description : If a variable is declared final, it must include ...................... value. A) integer B) no C) initial D) float

Last Answer : C) initial

Description : Which of the following is not the java primitive type A) Byte B) Float C) Character D) Long double

Last Answer : D) Long double

Description : Float a[15], what is the size of array? A) 17 B) 14 C) 15 D) 16

Last Answer : 16

Description : Which of the following is a valid SQL type? (A) CHARACTER (B) NUMERIC (C) FLOAT (D) All of the above

Last Answer : (D) All of the above

Description : What will happen if a predecessor description is generated that is satisfied by the initial state of the planning problem? a) Success b) Error c) Compilation d) Termination

Last Answer : d) Termination

Description : What are the default values of the primitive datatypes int and float?

Last Answer : Ans. The default value of int is 0 and the default value of float is 0.0f.

Description : Consider f(N) = g(N) + h(N) Where function g is a measure of the cost of getting from the start node to the current node N and h is an estimate of additional cost of getting from the current ... ? (A) A* algorithm (B) AO* algorithm (C) Greedy best first search algorithm (D) Iterative A* algorithm

Last Answer : (C) Greedy best first search algorithm

Description : Let f(n) and g(n) be asymptotically non-negative functions. Which of the following is correct? (A) θ(f(n) * g(n)) = min(f(n), g(n)) (B) θ(f(n) * g(n)) = max(f(n), g(n)) (C) θ(f(n) + g(n)) = min(f(n), g(n)) (D) θ(f(n) + g(n)) = max(f(n), g(n))

Last Answer : (D) θ(f(n) + g(n)) = max(f(n), g(n))

Description : A method name myMethod( ) that needs two integer arguments is declared as A) public void myMethod( ); B) public void myMethod(int a, int b); C) public void myMethod(int a, b); D) public int myMethod(a, b);

Last Answer : B) public void myMethod(int a, int

Description : How many times does the following code segment execute int x=1, y=10, z=1; do{y--; x++; y-=2; y=z; z++} while (y>1 && z

Last Answer : A) 1

Description : Assume that variable x resides at memory location 1234, y at 1111 and p at 2222. Int x=1, y=2, *p; p=&x; y=*p; What will be the value of y after execution of above code? A) 2 B) 1 C) 1234 D) 1111

Last Answer : C) 1234

Description : main() { Int a=3, b=2, c*d*e; d=&a; e=&b; c=*d+*e; } Which one of the given answers is correct? A) a=4, c-6 B) a=3, c=5 C) a=3, c=6 D) a=3, c=8

Last Answer : B) a=3, c=5

Description : int[ ] ={5,6,7,8,9} What is the value of a[3]? A) 9 B) 8 C) 7 D) 6

Last Answer : B) 8

Description : When the following code is executed what will be the value of x and y? int x = 1, y=0; y = x++; (A) 2, 1 (B) 2, 2 (C) 1, 1 (D) 1, 2

Last Answer : (A) 2, 1

Description : The correct way to round off a floating number x to an integer value is (A) y = (int)(x+0.5) (B) y = int(x+0.5) (C) y = (int)x+0.5 (D) y = (int)((int)x+0.5)

Last Answer : (A) y = (int)(x+0.5)

Description : What does the following declaration mean ? int (*ptr) [10]; (A) ptr is an array of pointers of 10 integers. (B) ptr is a pointer to an array of 10 integers. (C) ptr is an array of 10 integers. (D) none of the above.

Last Answer : (B) ptr is a pointer to an array of 10 integers.

Description : What will be the output of the following ‘C’ code ? main ( ) { int x = 128; printf (“\n%d”, 1 + x++); } (A) 128 (B) 129 (C) 130 (D) 131

Last Answer :  (B) 129

Description : The Servlet Response interface enables a servlet to formulate a response for a client using the method ............... (A) void log(Exception e, String s) (B) void destroy() (C) int getServerPort() (D) void setContextType(String Type)

Last Answer : (D) void setContextType(String Type)

Description : A three dimensional array in C' is declared as int A[x][y][z]. Here, the address of an item at the location A[p][q][r] can be computed as follows (where w is the word length of an integer): (A) &A[0][0][0]+w(y*z*q+z*p+r) (B) &A ... *q+r) (C) &A[0][0][0]+w(x*y*p+z*q+r) (D) &A[0][0][0]+w(x*y*q+z*p+r)

Last Answer : Answer: B

Description : Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x < 100) x = CBSE (x +10); return (x - 1); } public static void main (String[] args){ System.out.print(First.CBSE(60)); } } What does this program print? (1) 59 (2) 95 (3) 69 (4) 99

Last Answer : (2) 95 

Description : Consider a disk queue with request for input/output to block on cylinders  98, 183, 37, 122, 14, 124, 65, 67  in that order. Assume that disk head is initially positioned at cylinder 53 and moving ... and 252 cylinders (B) 640 and 236 cylinders (C) 235 and 640 cylinders (D) 235 and 252 cylinders

Last Answer : Answer: 236 and 208 cylinders Explanation: SSTF Initial head position =53 The closest queue to initial head position=65 head moves from 53 to 65=12 head moves from 65 to 67=2 head moves from 67 ... 122=24 head moves from 122 to 124=2 head moves from 124 to 183=59 Total head movement=208 

Description : The Maximum payload of a TCP segment is (A) 65,535 (B) 65,515 (C) 65,495 (D) 65,475

Last Answer : (C) 65,495

Description : A perceptron has input weights W1 = -3.9 and W2 = 1.1 with threshold value T = 0.3. What output does it give for the input x1 = 1.3 and x2 = 2.2? (A) -2.65 (B) -2.30 (B) 0 (D) 1

Last Answer : Answer: C

Description : The order of a leaf node in a B+ tree is the maximum number of children it can have. Suppose that block size is 1 kilobytes, the child pointer takes 7 bytes long and search field value takes 14 bytes long. The order of the leaf node is ............ (1) 16 (2) 63 (3) 64 (4) 65

Last Answer : Answer: All

Description : You own Dude, Inc., which manufactures wooden tables. You need to hire some accountants to prepare your monthly financial statements. The preparation of your financial statements is referred to as a(n) a. Audit. b. Review. c. Compilation. d. Special report

Last Answer : Compilation.