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",* (& S[3]));

printf ("%s", S+4);

printf ("%u", S);

/* Base address of S is 1000 */

}

(A) ABCDEFGH1000 (B) CDEFGH1000

(C) DDEFGHH1000 (D) DEFGH1000

1 Answer

Answer :

(D) DEFGH1000

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 : 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 : 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 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 : If we define putchar function in putchar :. char -> IO () syntax than character input as an argument andreturns a. Useful value b. Get output c. Getno output d. None of these

Last Answer : c. Getno output

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 : Consider an array A[20, 10], assume 4 words per memory cell and the base address of array A is 100. What is the address of A[11, 5] ? Assume row major storage. (A) 560 (B) 565 (C) 570 (D) 575

Last Answer : (A) 560

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

Description : Suppose d = { john :40, peter :45}, what happens when we try to retrieve a value using the expression d[ susan ]? a) Since susan is not a value in the set, Python raises a KeyError ... Python raises a KeyError exception d) Since susan is not a key in the set, Python raises a syntax error

Last Answer : c) Since “susan” is not a key in the set, Python raises a KeyError exception

Description : Process of removing errors called a) Error Free b) Debug c) Syntax Error d) Exception

Last Answer : b) Debug

Description : A solid is shown in the figure below. The vertices ABCDEFGH form a 4 cm × 2 cm × 2 cm cuboid. The segments AI and DI are both of length 5 cm, and points ICGFB are coplanar. What is the height (in cm) of point I from the base rectangle EFGH? 

Last Answer : 4.80-4.84

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 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 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 : The translator which performs macro calls expansion is called : (A) Macro processor (B) Micro pre-processor (C) Macro pre-processor (D) Dynamic linker

Last Answer : (C) Macro pre-processor 

Description : In an operating system, indivisibility of operation means : (A) Operation is interruptable (B) Race - condition may occur (C) Processor can not be pre-empted (D) All of the above 

Last Answer : (C) Processor can not be pre-empted 

Description : What can the President do if a State fails to comply with the Directives of the Central Government? (1) He can dissolve State Legislature and order fresh elections (2) He can declare the break-down ... (3) He can send paramilitary forces to the State to secure compliance (4) Any of the above

Last Answer : (2) He can declare the break-down aconstitutional machinery in the State and assume responsibility for the governance of the State Explanation: If the President is satisfied, on the basis of the ... six months to a maximum period of three years with repeated parliamentary approval every six months.

Description : Which one of the following describes the syntax of prolog program ? I. Rules and facts are terminated by full stop (.) II. Rules and facts are terminated by semicolon (;) III. Variables names must start with upper case alphabets. ... alphabets. Codes : (A) I, II (B) III, IV (C) I, III (D) II, IV

Last Answer : (C) I, III

Description : What is the most appropriate function of Memory Management Unit (MMU) ? (A) It is an associative memory to store TLB (B) It is a technique of supporting multiprogramming by creating dynamic partitions ... to physical address (D) It is an algorithm to allocate and deallocate main memory to a process 

Last Answer : (C) It is a chip to map virtual address to physical address

Description : Which of the following is/are restriction(s) in classless addressing ? (A) The number of addresses needs to be a power of 2. (B) The mask needs to be included in the address to define the block. (C) The starting address must be divisible by the number of addresses in the block. (D) All of the above

Last Answer : (D) All of the above

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 : Consider a discrete memoryless channel and assume that H(x) is the amount of information per symbol at the input of the channel; H(y) is the amount of information per symbol at the output of the channel; H(x|y) is the amount of uncertainty ... (H(x) - H(x|y))]  p(x) (D) max H(x|y)  p(x)

Last Answer : (D) max H(x|y)   p(x)

Description : Assume that a program will experience 200 failures in infinite time. It has now experienced 100 failures. The initial failure intensity was 20 failures/CPU hr. Then the current failure intensity will be (A) 5 failures/CPU hr (B) 10 failures/CPU hr. (C) 20 failures/CPU hr. (D) 40 failures/CPU hr.

Last Answer : (B) 10 failures/CPU hr.

Description : What will be the output of the following Python code? nums = set([1,1,2,3,3,3,4,4])print(len(nums)) a) 7 b) Error, invalid syntax for formation of set c) 4 d) 8

Last Answer : Answer: c Explanation: A set doesn’t have duplicate items.

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 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 : Consider the following statements related to compiler construction: I. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. II. Syntax Analysis is specified by regular expressions and implemented by ... Only l (2) Only ll (3) Both I and II (4) Neither I nor Il

Last Answer : Answer: 4

Description : Why is my child such a *%S!& liar?

Last Answer : all kids tell lies

Description : What will be the output? d1 = {"john":40, "peter":45} Page No 40 d2 = {"john":466, "peter":45} d1 == d2 a) True b) False c) None d) Error

Last Answer : b) False

Description : What is the output of the following? print("xyyzxyzxzxyy".count('yy')) a) 2 b) 0 Page No 23 c) error d) none of the mentioned

Last Answer : a) 2

Description : What is the output when following statement is executed ? >>>print('new' 'line') a) Error b) Output equivalent to print ‘new\nline’ Page No 22 c) newline d) new line

Last Answer : c) newline

Description : What is the output of the following? i = 0 while i < 3: Page No 15 print(i) i += 1 else: print(0) a) 0 1 2 3 0 b) 0 1 2 0 c) 0 1 2 d) error

Last Answer : b) 0 1 2 0

Description : hat is the output of the following? i = 5 while True: if i%0O11 == 0: Page No 12 break print(i) i += 1 a) 5 6 7 8 9 10 b) 5 6 7 8 c) 5 6 d) error

Last Answer : b) 5 6 7 8

Description : What is the output of the following? i = 1 Page No 11 while True: if i%3 == 0: break print(i) i + = 1 a) 1 2 b) 1 2 3 c) error d) none of the mentioned

Last Answer : c) error

Description : In connection with the element of professional development, a CPA firm's system of quality control should ordinarily provide that all personnel a. Possess judgment, motivation, and adequate ... review directives. d. Have the knowledge required to enable them to fulfill responsibilities assigned.

Last Answer : Have the knowledge required to enable them to fulfill responsibilities assigned.

Description : The compiler _ translate a program code with any syntax error: a. Can b. Cannot c. Without d. None of these

Last Answer : b. Cannot

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 : The maximum efficiency of transmission through a pipe is (A) 50 % (B) 56.7 % C) 66.67 % (D) 76.66 %

Last Answer : Answer: Option C

Description : Which of the following are Gigabit Ethernets? A) 1000 BASE-SX B) 1000 BASE-LX C) 1000 BASE-CX D) All of above

Last Answer : D) All of above

Description : Which of the following are Gigabit Ethernets? A) 1000 BASE-SX B) 1000 BASE-LX C) 1000 BASE-CX D) All of the above

Last Answer : D) All of the above

Description : IEEE 802.3ab defines Gigabit Ethernet transmission over unshielded twisted pair (UTP) category 5, 5e or 6 cabling known as .................... A) 1000 BASE-T B) 1000 BASE-SX C) 1000 BASE-LX D) 1000 BASE-CX

Last Answer : A) 1000 BASE-T

Description : In a fast Ethernet cabling, 100 Base-TX uses ........... cable and maximum segment size is ............ (A) twisted pair, 100 metres (B) twisted pair, 200 metres (C) fibre optics, 1000 metres (D) fibre optics, 2000 metres

Last Answer : (A) twisted pair, 100 metres

Description : Write a C program Reading and Writing data using Scanf() and Printf() statement -Technology

Last Answer : #include int main(){ char ch; char str[100]; printf('Enter any character '); scanf('%c', &ch); printf('Entered character is %c ', ch); printf('Enter any string ( upto 100 ... , str);}OUTPUT:Enter any characteraEntered character is aEnter any string ( upto 100 character )haiEntered string is hai

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 will be the output? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2 a) True b) False c) Error d) None

Last Answer : c) Error

Description : What will be the output? d = {"john":40, "peter":45} "john" in d a) True b) False c) None d) Error

Last Answer : a) True

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 will be the output? >>>my_tuple = (1, 2, 3, 4) >>>my_tuple.append( (5, 6, 7) ) >>>print len(my_tuple) a) 1 b) 2 c) 5 d) Error

Last Answer : c) 5