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

1 Answer

Answer :

 (B) 129

Related questions

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 : 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 : Which of the following articles makes the Supreme Court a Court of Record? (1) 127 (2) 128 (3) 129 (4) 130

Last Answer : (3) 129 Explanation: According to Article 129 of the Constitution Supreme Court to be a court of record. The Supreme Court shall be a court of record and shall have all the powers of such a court including the power to punish for contempt of itself.

Description : Due to the growth of the internet and the predicted depletion of available addresses, a new version of IP version 6 using _____for the address was developed in 1995: a) 128 Bits b) 129 Bits c) 130 Bits d) None of These

Last Answer : a) 128 Bits

Description : Due to the growth of the internet and the predicted depletion of available addresses, a new version of IP version 6 using _____for the address was developed in 1995: a) 128 Bits b) 129 Bits c) 130 Bits d) None of These

Last Answer : a) 128 Bits

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 : Net generation of energy on complete oxidation of palmitic acid is (A) 129 ATP equivalents (B) 131 ATP equivalents (C) 146 ATP equivalents (D) 148 ATP equivalents

Last Answer : Answer : D

Description : Net ATP generation on complete oxidation of stearic acid is (A) 129 (B) 131 (C) 146 (D) 148

Last Answer : Answer : C

Description : The average scores of a batch of students in a test is 84. The 36% of students's average score is 57 and 42% of students's score is 84. Then find the average score of remaining 22% of students approximately, A) 128 B) 131 C) 119 D) 106 

Last Answer : Answer: A)  let the number of students be 100, then, 100*84 = 36*57 + 42*84 + 22*x 22x = 8400-2052-3528 x = 128.18

Description : How many times the word 'print' shall be printed by the following program segment? for(i=1, i≤2, i++) for(j=1, j≤2, j++) for(k=1, k≤2, k++) printf("print/n") (A) 1 (B) 3 (C) 6 (D) 8

Last Answer : (D) 8

Description : √6889+√3721+√1024-√2401=? a) 129 b) 128 c) 127 d) 124 e) 123

Last Answer : √6889 + √3721 +√1024 - √2401 = ? Or,?= √(83)2 + √(61)2 + √(32)2 - √(49)2 =83+61+32 – 49 =127 Answer: c)

Description : The value of postfix expression: 8 3 4 + - 3 8 2 / + * 2 $ 3+ is (A) 17 (B) 131 (C) 64 (D) 52

Last Answer : (D) 52

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 : 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 : 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 : Arul can do a certain work in 9 days while Ravi can do the same work in 7 days. Both of them complete the work together and get Rs.288. what is the share of Arul? a) Rs.124 b) RS.126 c) Rs.128 d) Rs.130

Last Answer : B Arul’s 1 day work = 1/9 Ravi’s 1 day work = 1/7 Arul’s salary : Ravi’s salary = Arul’s 1 day work : Ravi’s 1 day work = 1/9 : 1/7 = 7 :9 Arul’s share = Rs.(7/16 *288) =Rs.126

Description : What is the output of printf("%d")?

Last Answer : 1. When we write printf("%d",x); this means compiler will print the value of x. But as here, there is nothing after ï ½%dï ½ so compiler will show in output window garbage value. 2. When we ... an error without the proper number and type of arguments for things like printf(...) and scanf(...).

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 : 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 : Which of the following statement is true? i) An address with all bits 1 is interpreted as all networks or all hosts. ii) The class A network 128.0.0.0 is defined as the loopback network. A) i only B) ii only C) Both A and B D) None of the above

Last Answer : A) i only

Description : Suppose a digitized voice channel is made by digitizing 8 kHz bandwidth analog voice signal. It is required to sample the signal at twice the highest frequency (two samples per hertz). What is the bit rate required, if it ... sample requires 8 bits? (A) 32 kbps (B) 64 kbps (C) 128 kbps (D) 256 kbps

Last Answer : (C) 128 kbps

Description : Consider a disk queue with I/O requests on the following cylinders in their arriving order: 6,10,12,54,97,73,128,15,44,110,34,45 The disk head is assumed to be at cylinder 23 and moving in the direction ... . The disk head movement using SCAN-scheduling algorithm is: (1) 172 (2) 173 (3) 227 (4) 228

Last Answer : (2) 173

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 : 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 : 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 : What is the output of the following code? a={1:"A",2:"B",3:"C"} a.clear() print(a) a) None b) { None:None, None:None, None:None} c) {1:None, 2:None, 3:None} d) { }

Last Answer : d) { }

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} b={4:"D",5:"E"} a.update(b) print(a) a) {1: ‘A’, 2: ‘B’, 3: ‘C’} b) Method update() doesn’t exist for dictionaries c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’} d) {4: ‘D’, 5: ‘E’}

Last Answer : c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} a.setdefault(4,"D") print(a) a) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}. b) None. c) Error.

Last Answer : a) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}.

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} print(a.setdefault(3)) a) {1: ‘A’, 2: ‘B’, 3: ‘C’} b) C c) {1: 3, 2: 3, 3: 3} d) No method called setdefault() exists for dictionary

Last Answer : b) C

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} print(a.get(5,4)) a) Error, invalid syntax b) A c) 5 d) 4

Last Answer : d) 4

Description : What is the output of the following piece of code? a={1:"A",2:"B",3:"C"} print(a.get(1,4)) a) 1 b) A c) 4

Last Answer : b) A

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} for i,j in a.items(): print(i,j,end=" ") a) 1 A 2 B 3 C b) 1 2 3 c) A B C d) 1:”A” 2:”B” 3:”C”

Last Answer : a) 1 A 2 B 3 C

Description : What is the output of the following piece of code? >>> a=(0,1,2,3,4) >>> b=slice(0,2) >>> a[b] a) Invalid syntax for slicing b) [0,2]. c) (0,1) d) (0,2)

Last Answer : c) (0,1)

Description : What is the output of the following code? >>> a=(2,3,4) >>> sum(a,3) a) Too many arguments for sum() method b) The method sum() doesn’t exist for tuples c) 12 d) 9

Last Answer : c) 12

Description : What is the output of the following code? >>> a=(1,2,3,4) >>> del(a[2]) a) Now, a=(1,2,4) b) Now, a=(1,3,4) c) Now a=(3,4) d) Error as tuple is immutable

Last Answer : d) Error as tuple is immutable

Description : What is the output of the following piece of code when executed in Python shell? >>> a=("Check")*3 >>> a a) (‘Check’,’Check’,’Check’) b) * Operator not valid for tuples c) (‘CheckCheckCheck’) d) Syntax erro

Last Answer : c) (‘CheckCheckCheck’)

Description : What is the output when following code is executed ? >>>list1 = [11, 2, 23] >>>list2 = [11, 2, 2] >>>list1 < list2 is a) True b) False c) Error d) None

Last Answer : b) False

Description : What is the output when following code is executed ? names1 = ['Amir', 'Bear', 'Charlton', 'Daman'] names2 = names1 names3 = names1[:] names2[0] = 'Alice' names3[1] = 'Bob' sum = 0 for ls in (names1, names2, names3): ... if ls[1] == 'Bob': sum += 10 print sum a) 11 b) 12 c) 21 d) 22

Last Answer : d) 22

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 : What is the output when following code is executed ? >>>str1="helloworld" >>>str1[::-1] a) dlrowolleh b) hello c) world d) helloworld

Last Answer : a) dlrowolleh

Description : hat is the output when following code is executed ? >>>print r"\nhello" The output is a) a new line and hello b) \nhello c) the letter r and then hello d) error

Last Answer : d) error

Description : What is the output when following code is executed ? >>> str1 = 'hello' >>> str2 = ',' >>> str3 = 'world' >>> str1[-1:] a) olleh b) hello c) h d) o

Last Answer : b) hello

Description : printf ("%" d,% x ", & b); Explain the statement ?

Last Answer : printf ( % d,% x , & b); Here , the printf statement displays the output function printf () function as a variable data result of different data types. The C program is used to ... b respectively which indicates the memory location of integer type a and b variables where data will be stored.

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 : 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 : 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 : 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 : 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

Last Answer : D