You are on page 1of 36

1] Which of the following special symbol allowed in a variable name

A. "* (asterisk)"

B. "| (pipeline)"

C. "- (hyphen)"

D. "_ (underscore)"

Correct answer is: Option D

2] In mathematics and computer programming, which is the correct o

A. Addition, Subtraction, Multiplication, Division

B. Division, Multiplication, Addition, Subtraction

C. Multiplication, Addition, Division, Subtraction

D. Addition, Division, Modulus, Subtraction

Correct answer is: Option B

3] Which of the followin

A. "&"

B. "&&"

C. "||"
D. "!"

Correct answer is: Opt

4] Which of the following i


operators used in C?

A. "a>b ? c=30 : c=40;"

B. "a>b ? c=30;"

C. "max = a>b ?a:c;"

D. "return (a>b)?(a:b)"

Correct answer is: Optio

5] The keyword used to tran


calling function is

A. switch

B. goto

C. go back

D. return

Correct answer is: Option


6] If a variable is a pointer to a structure, then which of the following
of the structure through the pointer variable?

A. "."

B. " &"

C. " *"

D. " ->"

Correct answer is: Option D

7] A pointer is?

A. A keyword used to create va

B. A variable that stores addre

C. A variable that stores addre

D. All of the above

Correct answer is: Option C

8] If the two strings are identical

A. "-1"

B. "0"

C. "1"
D. yes

Correct answer is: Option B

9] How will you print \n on the

A. "printf("\\n");"

B. "echo "\\n";"

C. "printf('\n');"

D. "printf("\n");"

Correct answer is: Option A

10] What is the similarity between

A. All of them let you define new v

B. All of them let you define new d

C. All of them let you define new p

D. All of them let you define new s

Correct answer is: Option B

11] The index or subscript value for

A. "1 to n-1"
B. "0 to n-1"

C. "1 to n"

D. "0 to n"

Correct answer is: Option B

12] Identify the incorrect declaration of arrays from the following?

A. "int a[50];"

B. "float values[10][20];"

C. "double a[50];"

D. "int score[10,15];"

Correct answer is: Option D

13] Array is used to represent the following

A. A list of data items of same data type

B. A list of data items of different data typ

C. A list of data items of real data type.

D. A list of data items of integer data type.

Correct answer is: Option A


14] When we use the case control structure

A. To choose one from multiple alternative

B. To switch from one instruction to anoth

C. To make the execution fast.

D. none of the above

Correct answer is: Option A

15] The case Keyword is followed by

A. Float values.

B. character values

C. integer values

D. both B & C

Correct answer is: Option D

16] A character variable can at a time store

A. "1 Character"

B. "2 Character"

C. "254 Character"

D. None of above.
Correct answer is: Option A

17] which statement is false in c langua

A. variable names are inbuilt & consta

B. Variable names can contain a digit.

C. Variable names do not contain a bla

D. Capital letters can be used in variab

Correct answer is: Option A

18] ……...function is one that returns no

A. float

B. void

C. int

D. none of the above

Correct answer is: Option B

19] Fuction call themselfes again & again…

A. recursion

B. call by value

C. call by reference
D. none of the above

Correct answer is: Option A

20] C language has been developed by ?

A. Ken Thompson

B. Dennis Ritchie

C. Peter Norton

D. Martin Richards

Correct answer is: Option B

21] The C language includes the header file stand

A. stdlib.h library

B. #include library

C. conio.h library

D. stdio.h library

Correct answer is: Option D

22] Set of values of the same type, which have a sin


A. function

B. structure

C. array

D. union

Correct answer is: Option C

23] The function fprintf is used in a program?

A. When too many printf calls have been already u

B. In place of printf, since printf uses more memor

C. When the output is to be printed on to a file.

D. When the type of variables to be printed are not

Correct answer is: Option C

24] …………….. Called as jumping loop?

A. For

B. goto

C. while

D. dowhile
Correct answer is: Option B

25] int **ptr; is?

A. Pointer to pointer

B. Invalid declaration

C. Pointer to integer

D. none of the above

Correct answer is: Option A

26] Typecasting makes the……………..?

A. pointer conversion

B. function conversion

C. data type conversion

D. none of the above

Correct answer is: Option C

27] A flowchart is a…...representation of the steps nec

A. pictorical

B. numerical
C. operators

D. none of the above

Correct answer is: Option A

28] The step-by-step instructions that solve a problem

A. a sequential structure

B. a list

C. a plan

D. an algorithm

Correct answer is: Option D

29] A do-while loop is used to ensure that the statements w

A. "2 times"

B. once

C. "3 times"

D. none of tha above

Correct answer is: Option B

30] C language provides a method to pass parameters to


A. command line argument

B. call by reference

C. recursion

D. none of tha above

Correct answer is: Option A

31] What will output of following code? "int main(){ int x=10,y
y=%d ",x,y); }"

A. "10,15"

B. "10,16"

C. "11,16"

D. "11,15"

Correct answer is: Option C

33] "int main() { int i=0,a[3];a[i]=i++; printf( "%d ",a[i]);

A. Garbage value

B. "1"
C. "0"

D. none of the above

Correct answer is: Option A

34] int main() { int k=12,n=30; k=k>5 && n==4?100:200; pr

A. "12"

B. "100"

C. "200"

D. "30"

Correct answer is: Option C

35] "int main() {int a=5,b,c; b=a=15; c=a<15; printf( "%d%d%

A. "5 15 15"

B. "15 15 15"

C. "15 15 1"

D. "15 15 0"

Correct answer is: Option D


36] "Find Error int main() { int a,b;printf( "\n enter a b= "); scanf
",a,b); } "

A. Statement missing ;

B. No Error Program Execute

C. Expression Syntax

D. declaration syntax error

Correct answer is: Option B

37] Which of the statements is correct about the program? "int main

A. j and i are pointers to an int

B. i is a pointer to an int and stores address of j

C. j is a pointer to an int and stores address of i

D. j is a pointer to a pointer to an int and stores address of i

Correct answer is: Option C

38] "int main() { int i; int a[]=(10,20,30,40);for(i=0;i<=3;i++) { pr

A. undefine symbol a

B. declaration syntax error


C. missing } brackets

D. undefined symbol i

Correct answer is: Option B

39] "int main() { int i=6; if(i>4) printf( "\n i=%d ",i) } "

A. warning

B. if statement missing

C. Statement missing ;

D. declaration syntax error

Correct answer is: Option C

40] "int main(); { printf( "welcome "); }"

A. Statement missing ;

B. Declaration terminated incorrectly

C. function call missing;

D. none of tha above

Correct answer is: Option B


41] "int main() { for(i=1;i<=3;i++) { printf( "%d ",i); } } "

A. function call missing;

B. undefine symbol i

C. function should return a value

D. function should not return a value

Correct answer is: Option B

42] A function cannot be defined inside another function

A. "TRUE"

B. "FALSE"

C.

D.

Correct answer is: Option A

43] Which standard library function will you use to find the last occura

A. "strnchar()"

B. "strchar()"

C. "strrchar()"

D. "strrchr()"
Correct answer is: Option D

44] In the following code, the P2 is Integer Pointer or Integer?typedef

A. Integer

B. Integer pointer

C. Error in declaration

D. None of above

Correct answer is: Option B

45] Which of the following function sets first n characters of a string to

A. "strinit()"

B. "strnset()"

C. "strset()"

D. "strcset()"

Correct answer is: Option B

46] Which of the following function is used to find the first occurrence

A. "strchr()"

B. "strrchr()"
C. "strstr()"

D. "strnset()"

Correct answer is: Option C

47] What will be output if you will compile and execute the following
a=5,b=10,c=15; int *arr[]={ a, b, c}; printf( "%d ",*arr[1]); return 0

A. "5"

B. "10"

C. "15"

D. Compiler error

Correct answer is: Option D

48] What will be output when you will execute following c code? "#in
",sizeof(6.5)); printf( "%d\t ",sizeof(90000)); printf( "%d ",sizeof('A

A. "4 2 1"

B. "8 2 1"

C. "8 4 1"

D. "8 4 2"

Correct answer is: Option A


49] Which of the following is not modifier of data type in c?

A. extern

B. interrupt

C. register

D. All of these are modifiers of data type

Correct answer is: Option D

50] Consider on following declaration: (i) short i=10; (ii) static i=10; (

A. "Only (iv) is incorrect"

B. "Only (ii) and (iv) are incorrect"

C. "Only (iii) is correct"

D. none are correct

Correct answer is: Option D

51] What will be output when you will execute following c code? "#in
",a); return 0; }"

A. "11"

B. Garbage
C. "-2"

D. We cannot predict

Correct answer is: Option A

52] What is the range of signed int data type in that compiler in which

A. "-255 to 255"

B. "-32767 to 32767"

C. "-32767 to 32768"

D. "-32768 to 32767"

Correct answer is: Option D

53] Which of the following is not derived data type in c?

A. Function

B. Pointer

C. Enumeration

D. All are derived data type

Correct answer is: Option C


54] What will be output when you will execute following c code? "#in
"; printf( "%s ",arr); } "

A. Network

B. N

C. Garbage value

D. warning

Correct answer is: Option A

55] What will be output of following program? "#includeint main(){ in


printf( "%u %u %d ",k,*k,**k); return 0; }"

A. "Address, Address, 3 "

B. "Address, 3, 3"

C. "3, 3, 3"

D. Compilation error

Correct answer is: Option A

56] What will be output of following program? "#include#include int m


",sizeof(p),sizeof(q)); return 0; } "

A. "2 2"
B. "4 4"

C. "4 2"

D. Error

Correct answer is: Option A

57] What will be output of following program? "#include#includeint m


= &b;c = p - q;printf("%d" , c);return 0;}"

A. "1"

B. "5"

C. "-5"

D. Compilation error

Correct answer is: Option A

58] What will be output of following program? "#includeint main(){ in


return 0; } "

A. "2"

B. "4"

C. "8"

D. None of above
Correct answer is: Option A

59] "#include int a=50; int main(){ int a=10; printf( "%d ",a); return 0;

A. "50"

B. "10"

C.

D.

Correct answer is: Option B

60] "#include int main() { char *str= "CQUESTIONBANK "; printf(st


you compile and run the above code?

A. CQESTIONBANK

B. CQUESTION

C. BANK

D. Compiler error

Correct answer is: Option C

61] Which of the following are C preprocessors?

A. "#ifdef"
B. "#define"

C. "#endif "

D. All of the mentioned

Correct answer is: Option B

62] The C-preprocessors are specified with _________symbol.

A. "#"

B. "$"

C. ""

D. None of the mentioned

Correct answer is: Option A

63] The #include directive

A. Tells the preprocessor to grab the text of a file and place it directly

B. Statements are typically placed at the top of a program

C. both a & b

D. None of a & b

Correct answer is: Option C


64] If #include is used with file name in angular brackets

A. The file is searched for in the standard compiler include paths

B. The search path is expanded to include the current source directory

C. Both a & b

D. None of the mentioned

Correct answer is: Option A

65] What is (void*)?

A. Representation of NULL pointer

B. Representation of void pointer

C. Error

D. None of above

Correct answer is: Option A

66] Can you combine the following two statements into one? char "*p;

A. " char p = *malloc(100);"

B. " char *p = (char) malloc(100);"

C. " char *p = (char*)malloc(100);"

D. "char *p = (char *)(malloc*)(100);"


Correct answer is: Option C

67] What would be the equivalent pointer expression for referring the a

A. "((((a+i)+j)+k)+l)"

B. "*(*(*(*(a+i)+j)+k)+l)"

C. "(((a+i)+j)+k+l)"

D. "((a+i)+j+k+l)"

Correct answer is: Option B

68] The operator used to get value at address stored in a pointer variab

A. "*"

B. "&"

C. " &&"

D. " ||"

Correct answer is: Option A

69] Which of the following is the correct order of evaluation for the be
1"

A. "* / % + - ="
B. "= * / % + -"

C. "/ * % - + ="

D. "* % / - + ="

Correct answer is: Option A

70] In which order do the following gets evaluated 1. Relational 2. Ari

A. "2134"

B. "1234"

C. "4321"

D. "3214"

Correct answer is: Option A

71] What will be output when you will execute following c code? "#in
printf( "M.S. Dhoni "); else if(a>20) printf( "M.E.K Hussey "); else

A. M.S. Dhoni

B. A.B. de villiers

C. M.S Dhoni M.E.K Hussey A.B. de Villiers

D. None of the above


Correct answer is: Option A

72] What will be output when you will execute following c code? "#in
if(++a||++b) printf( "%d %d ",a,b); else printf( "John Terry "); } "

A. "5 10"

B. "6 11"

C. "6 10"

D. "5 11"

Correct answer is: Option C

73] Which of the following statements should be used to obtain a rema

A. "rem = 3.14 % 2.1;"

B. "rem = modf(3.14, 2.1);"

C. "rem = fmod(3.14, 2.1);"

D. Remainder cannot be obtain in floating point division.

Correct answer is: Option A

74] Is there any difference between following declarations? 1 : extern i

A. Both are identical


B. No difference, except extern int fun(); is probably in another file

C. int fun(); is overrided with extern int fun();

D. None of these

Correct answer is: Option B

75] By default a real number is treated as a

A. float

B. double

C. long double

D. far double

Correct answer is: Option A

76] Is the following statement a declaration or definition? extern int i;

A. Declaration

B. Definition

C. Function

D. Error

Correct answer is: Option A


77] Identify which of the following are declarations 1 : extern int x; 2 :
pow(double, double);

A. "1"

B. "2"

C. "1 and 3"

D. "3"

Correct answer is: Option C

78] When we mention the prototype of a function?

A. Defining

B. Declaring

C. Prototyping

D. Calling

Correct answer is: Option B

79] What are the different types of real data type in C ?

A. float, double

B. short int, double, long int


C. float, double, long double

D. double, long int, float

Correct answer is: Option C

80] What will you do to treat the constant 3.14 as a long double?

A. "use 3.14LD"

B. " use 3.14L"

C. "use 3.14DL"

D. "use 3.14LF"

Correct answer is: Option B

81] Which statement will you add in the following program to work it
"%f\n ", log(36.0)); return 0; } "

A. # include < conio.h >

B. # include < math.h >

C. # include < stdlib.h >

D. # include < dos.h >

Correct answer is: Option B


82] We want to round off x, a float, to an int value, The correct way to

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)"

Correct answer is: Option A

83] What will you do to treat the constant 3.14 as a float?

A. "use float(3.14f)"

B. "use 3.14f"

C. " use f(3.14)"

D. "use (f)(3.14)"

Correct answer is: Option B

84] Which of the following statement obtains the remainder on dividin

A. "rem = (5.5 % 1.3)"

B. "rem = modf(5.5, 1.3)"

C. "rem = fmod(5.5, 1.3) "


D. A and C

Correct answer is: Option D

85] What will be output when you will execute following c code? "#in
p= &a; printf( "%d ",*p); return 0; } "

A. "0"

B. "10"

C. Garbage value

D. Error: Cannot modify const object

Correct answer is: Option B

86] What will be output of following program? "#include int main(){ i


printf( "%u %u %d ",k,*k,**k); return 0; } "

A. "Address, Address, 3"

B. "Address, 3, 3"

C. "3, 3, 3"

D. Compilation error

Correct answer is: Option A


87] What will be output of following program? "#include #include int
= 0; strcpy(ptr1, "c"); strcpy(ptr2, "questions"); printf( "%s %s ",pt

A. c questions

B. c (null)

C. (null) (null)

D. Compilation error

Correct answer is: Option C

88] What will be output of following program? "#include int main(){ c


return 0; } "

A. world

B. w

C. Null

D. Compilation error

Correct answer is: Option A

89] What will be output of following program? "#include int main(){ i


p ,*p); }"

A. "5 5 "

B. Address Address
C. "Address 5"

D. Compilation error

Correct answer is: Option C

90] What will be output of following program? "#include int main(){ i


printf( "%u %u %u ",i,j,k); return 0; }"

A. "3 Address 3"

B. "3 Address Address"

C. " 3 3 3"

D. Compilation error

Correct answer is: Option B

91] What will be output when you will execute following c code? "#in
array[2][3]={5,10,15,20,25,30}; int *ptr= array; printf( "%d\t ",*pt
",*(ptr+2)); printf( "%d\t ",*

A. "5 10 15 20"

B. "10 15 30 20"

C. "5 15 20 30"

D. Compilation error
Correct answer is: Option D

92] What will be output when you will execute following c code? "#in
printf( "William Gates "); else printf( " Warren Buffet "); }"

A. William Gates

B. Warren Buffet Carlos Slim Helu

C. Run time error

D. None of the above

Correct answer is: Option A

You might also like