Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A) Martin Richards
B) Bijarne Stroustrup
C) Dennis Ritche
D) Ken Thompson
A) 9
B) 8
C) 7
D) 6
3. C can be used on
A) 17
B) 14
C) 15
D) 16
help of
A) An Editor
B) A complier
C) An operating system
6. Array is
A) [ ]
B) { }
C) ( )
A) Loop
B) If condition
C) Function
D) Structure
A) 2.5
B) 3
C) 0
D) 2
A) Value of variable
B) Address of variable
D) Always null
A) is most important
B) is used first
C) is fastest
D) No address
14. main() {
d=&a; e=&b;
c=*d+*e;
A) a=4, c-6
B) a=3, c=5
C) a=3, c=6
D) a=3, c=8
A) Blank Spaces
B) Decimal Point
C) Hyphen
16. Assume that variable x resides at memory location 1234, y at 1111 and p at 2222.
p=&x;
y=*p;
B) 1
C) 1234
D) 1111
18. 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
A) -6
B) 6
C) 4
A) DOS
B) Windows
C) Unix
A) Keywords
B) Variables
C) Constraints
A) a
B) b
C) m
D) n
A) printf
B) external
C) auto
D) scanf
A) streams.h
B) stdio.h
C) stdlib.h
D) files.h
A) is a computer program
C) is a part of software
D) editor
B) conversion
C) disjunction
D) separation
A) scanf
B) printf
C) getch
D) Char
31. There is a unique function in C++ program by where all C++ programs start their execution with ……..
A) start()
B) begin()
C) main()
D) output()
A) break
B) Goto
C) Exit
D) Switch
33. The memory address of the first element of an array is called ……………….
A) floor address
B) foundation address
C) first address
D) base address
34. C++ exception handling mechanism mainly uses how many keywords?
A) Four
B) Three
C) Two
A) Executed
B) Handled appropriately
C) Resolved
36. After defining the function template, the next step to call it in another function such as ………
A) int()
B) secondary()
C) template()
D) main()
A) Pointers
B) Derived classes
C) Virtual functions
D) Heap tree
A) iostream
B) string
C) sstring
D) sstream
A) c++;
B) c=c+1;
C) c+1=>c;
D) c+=1;
C) Assembly language
A) #
B) include
C) main()
D) {
43. C allows arrays of greater than two dimensions, who will determine this?
A) programmer
B) compiler
C) parameter
D) None of the above
A) Right shifting
B) Left shifting
C) Bitwise shifting
D) Bitwise complement
45. Set of values of the same type, which have a single name followed by an index is called
A) function
B) structure
C) array
D) union
46. Which of the following header file is required for strcpy() function?
A) String.h
B) Strings.h
C) file.h
D) strcpy()
A) double character
B) single character
C) multiple characters
D) no character
48. A variable which is visible only in the function in which it is defined is called
A) Static variable
B) auto variable
C) external variable
D) local variable
49. In the loop structure logical expression is checked at the ………………..of the loop.
A) first
B) end
C) middle
D) second
A) by value
B) by reference
C) by name
52. Which escape character can be used to begin a new line in C ……..
A) a
B) m
C) b
D) n
53. Input/output function prototypes and macros are defined in which header file?
A) conio.h
B) stdlib.h
C) stdio.h
D) dos.h
56. What will be output of the following C program? #include int main() {int goto=5; printf(“%d”,goto);
return 0;}
A) 5
B) 10
C) **
D) compilation error
57. Output of the following C program fragment is. x=5; y=x++; printf(“%d %d”, x,y);
A) 5, 6
B) 5, 5
C) 6, 5
D) 6, 6
58. What will be output of the following C program? #include int xyz=10; int main() { int xyz=20;
printf(“%d”, xyz); return 0;}
A) 10
B) 20
C) 30
D) compilation error
B) Prints 0
C) Is an error
D) In an infinite loop
60. What will be output of the following program? #include int main() {int a=2, b=7, c=10; c=a==b;
printf(“%d”,c); return 0;}
A) 0
B) 7
C) 10
D) 2
61. What is the output of the following program segment? main( ) { long i=65536; printf(“%dn”, i); }
A) 0
B) 65536
C) -1
D) 65
62. What will be the output of the program? # include int main() {int a[5]={5,1,15,20,25}; int i, j, m;
i=++a[1]; j=a[1]++; m=a[i++]; printf(“%d, %d, %d”, i,j,m); return0;}
A) 2, 1, 15
B) 1, 2, 5
C) 3, 2, 15
D) 2, 3, 20
63. What is the output of the following program segment? main( ) { int=1; do { printf(“%d . . “, i); } while
(i–); }
A) 0 . . 1 . .
B) 1 . . 0 . .
C) 0
D) -1
64. Output of the program below is. int i; main( ) { printf(“%d”, i); }
A) 1
B) 0
C) -1
D) Null
65. What will be the output of the following program? main( ) { int i=5; printf(“%d”, i=++i==6); }
A) 0
B) 7
C) 6
D) 1
A) !
B) ~
C) #
D) ;
67. If the size of the array is less than the number of initializes then, ……….
A) extra values are being ignored
68. In C, if you pass an array as an argument to a function, what actually gets passed?
69. How many times the following loop be executed? { .. ch=’b’; while (ch>=’a’ && ch<==’z’) ch++; }
A) 0
B) 25
C) 26
D) 1
70. If a=8 and b=15 then the statement x=(a>b) ? a:b;
A) assigns a value 8 to x
C) assigns a value 15 to x
D) assigns a value 7 to x
71. What is the output of the following code. int n=0, m=1; do { printf(“%d”, m); m++; } while (m<=n);
A) 0
B) 2
C) 1
D) 4
72. A C program contains the following declaration int i=8, j=5 what would be the value of following
expression? abs(i-2*j)
A) 2
B) 4
C) 6
D) 8
73. The output of the following is . int a=75; printf(“%d%%”, a);
A) 75
B) 75%%
C) 75%
74. How many times the following program would print (“abc”)? main( ) { printf(“nabc”); main( ); }
B) 32767 times
C) 65535 times
75. Which of the following is the correct usage of conditional operators used in C?
A) a>b?c=30:c=40;
B) a>b?c=30;
C) max=a>b?a>c?a:c:b>c?b:c
D) return (a>b)?(a:b)
76) ‘C’ allows a three way transfer of control with the help of
A. Unary Operator
B. Relational Operator
C. Ternary Operator
D. Comparison Operator
A. is most important
B. is used first
C. is faster
78) The statement that transfers control to the beginning of the loop is called ..
A. break statement
B. exit statement
C. continue statement
D. goto statement
A. Dennis Ritche
B. Ken Thompson
C. Bill Gates
D. Peter Norton
80) The value that follows the keyword CASE may only be
A. constants
B. variable
C. number
D. semicolon
A. a digit
B. an integer
C. a character
D. a word
82) The statement which is used to terminate the control from the loop is
A. break
B. continue
C. goto
D. exit
A. for
B. switch
C. do
D. while
84) A self contained block of statements that perform a coherent task of some kind is called a .
A. Monitor
B. Function
C. Program
D. Structure
A. do while
B. if else
C. goto
D. for
A. Circular definition
B. Complex definition
C. Procedure
D. Union
A. semicolon
B. comma
C. full stop
D. slash
88) The loop in which the statements within the loop are executed at least once is called
A. do-while
B. while
C. for
D. goto
89) The maximum length allowed in specifying the name of a C variable is ……..
A. 45
B. 31
C. 56
D. 78
100) Which of the following is a unformatted console I/O function to get a string input?
A. puts
B. gets
C. clrscr
D. scanf
A. assignment operator
B. relational operator
C. logical operator
B. Bitwise OR
C. Logical AND
D. Logical OR
A. assignment
B. increment
C. logical
D. relational
105) The control automatically passes the first statement after the loop in ..
A. Continue statement
B. Break statement
C. Switch statement
D. If statement
A. Float
B. Union
C. Array
D. Pointer
A. valid
B. invalid
C. indefinite
108) In C, a union is ……
A. memory location
B. memory store
C. memory screen
D. memory space
109) The ……… statement causes immediate exit from the loop overriding the condition test ..
A. Exit
B. Break
C. Goto
D. None of these
111) The keyword used to transfer control from a function back to the calling function is …
A. switch
B. goto
C. go back
D. return
B. comparison of pointers that do not point to the element of the same array
113) In C, if you pass an array as an argument to a function, what actually gets passed?
A. compiler commands
B. library functions
A. Character
B. Integer
C. Float
D. Enum
116) The printf() function returns which value when an error occurs?
A. Positive value
B. zero
C. Negative value
D. None of these
117) When array elements are passed to a function with their values, it is called as …
A. end value
B. call by value
C. return value
D. first value
119) In the for loop structure there are ………. optional clauses.
A. one
B. two
C. three
D. four
A. string.h
B. strings.h
C. text.h
D. strcmp.h
123) A structure …