jntu cds online bits

1. What is the appropriate order of refinement in a problem solving.
(a) pseudo code, flowchart, program
(b) flow chart, program, pseudo code
(c) program, flow chart, pseudo code
(d) flow chart, pseudo code program
2. A machine language program consists of instructions written in
(a) mnemonics
(b) english like words
(c) keywords
(d) 0’s and 1’s
3. Which of the following is not a keyword
(a) register
(b) enum
(c) signed
(d) storage
4. Size of (double) returns———
(a) 2
(b) 8
(c) 10
(d) 4
5. Array elements are stored in
(a) Scattered memory locations
(b) Random memory location
(c) Direct memory locations
(d) Sequential memory locations
6. Which of the following is shorthand operator for a=a%b
(a) a % b
(b) a%b=a
(c) a%=b
(d) a =%b
7. && and || are which kind of operators.
(a) Relational
(b) Logical
(c) Conditional
(d) Arithmetic
8. The symbol for one’s complement operator is:
(a) |
(b) ^
(c) &
(d) _
9. The operation between integer and float always yield result in
(a) character
(b) float
(c) constant
(d) Integer
10. The single character input/output functions are
(a) getchar and printf
(b) scanf and printf
(c) scanf and putchar
(d) getchar and putchar
11. The conditional operators “ ? :” is similar to
(a) if-then-else
(b) do-while
(c) while
(d) nested if
12. Which one of the following is not a loop control structure.
(a) do-while
(b) if
(c) For
(d) while
13. The value within the [] brackets in an array declaration specifies
(a) subscript value
(b) value of the array element
(c) size of an array
(d) address value
14. An array which contains two subscripts, to represent each element is called as
(a) two dimensional
(b) one dimensional
(c) three dimensional
(d) multidimensional
15. Literal means
(a) A string constant
(b) An alphabet
(c) A character
(d) A string
16. Any function can be called from any other function. This statement is
(a) neither true nor false
(b) true
(c) false
(d) true some tines
17. Arrays are passed as arguments to a function by
(a) context
(b) both value and reference
(c) reference
(d) value
18. In the following C-statement, what is the datatype of d and st respectively.
Printf {“\t%.s\n”, d, st);
(a) character, string
(b) digit, string
(c) string, string
(d) digit, character
19. The register class cannot used for all types of variables. This is because
(a) register variables usage decreases the system performance
(b) register variable precision in less
(c) number of bits in the register are less than the size of same variable types
(d) register variables cannot support arithmetic operations
20. Which of the following is a correct way of defining a symbolic constant pie in C
(a) # Define pie 22/7
(b) #define pie 22/7
(c) # define pie = 22/7
(d) #define pie= 3.142
D D D B D C B D B D A B C A A B C B C B
1. A compiler compiles the source code
(a) based on language
(b) one line at a time
(c) Complete program at a time
(d) two lines at a time
2. A machine language program consists of instructions written in
(a) keywords
(b) 0’s and 1’s
(c) mnemonics
(d) english like words
3. Among the following which is not a C token
(a) identifiers
(b) comment
(c) constants
(d) strings
4. The keyword is used to define a new data type.
(a) Structure
(b) union
(c) typedef
(d) array
5. C variable cannot start with
(a) an underscore
(b) a number
(c) an upper case letter
(d) a lower case
6. The value of 2%5 is
(a) 0
(b) 3
(c) 2
(d) 10
7. How many logical operators C provides?
(a) 3
(b) 2
(c) 4
(d) 1
8. Which of the following operators is used as a bit wise operator in C
(a) *
(b) <
(c) &
(d) %
9. The operation between integer and float always yield result in
(a) Integer
(b) float
(c) constant
(d) character
10. Which of the following statements is used to print value of the third element of an integer array called totals
(a) printf (“% c\n”, totals[2] );
(b) printf (“% d\n”, totals[3] );
(c) printf (“ % d\n ”, & totals[3] );
(d) printf (“% d\n”, totals[2] );
11. If statement is a —————statement
(a) loop construct
(b) two way decision
(c) multiway decision
(d) one-way decision
12. Identify the loop construct:
(a) goto
(b) if-else
(c) while
(d) switch-case
13. The total memory required for an array
(a) sizeof (datatype) * 2
(b) size of (datatype) * size of used array elements
(c) sizeof (datatype) * sizeof array
(d) size of (array) * datatype
14. int table [2][3] ={{0}, {0}} in this statement
(a) none of the element are initialized to zero
(b) only first row elements are initialized to zero
(c) only last row elements are initialized to zero
(d) all the array elements are initialized to zero
15. The statements that prints out the character set from A-Z is, where a is an integer variable
(a) for(a=‘A’; a<=‘z’, a++) printf(“%c”; a);
(b) for(a=‘A’; a<=‘z’, a++) printf(“%c”; a);
(c) for(a=‘a’; a<=‘z’, a++) printf(“%c”; a);
(d) for(a=’A’ a<=‘Z’, a++) printf(“%c”; a);
16. The names of actual parameters and formal parameters
(a) always same
(b) should be same
(c) need not be same
(d) almost same
17. ‘C’ language by default allows
(a) call by value
(b) call by pointer
(c) call by name
(d) call by reference
18. What will be the output of the following program?
void main()
{char txt[ ]
=

ABC\0DEF”;
printf(“%s %d”, txt, sizeof (txt));
}
(a) ABC\0DEF 7
(b) ABCDEF 8
(c) ABC 4
(d) ABC 8
19. The following program
main()
{inc(); inc(); inc();
}inc()
{static int x;
pritnf(“%d”, ++x);
}
(a) Prints 1 2 3
(b) Prints 0 1 2
(c) Prints three consecutive unpredictable numbers
(d) Prints 1 1 1
20. The header file that must be included at the beginning of a C program to use a library function cos is
(a) math.h
(b) conio.h
(c) dos.h
(d) stdlib.h
C B B C B C A C B D B C C D D C A D A A
1. The error in a program is called
(a) flow
(b) virus
(c) bug
(d) vaccine
2. The character which is used as a statement terminator in a ‘C’ program is
(a) ,
(b) .
(c) ;
(d) :
3. Which of the following is a valid ‘C’ variable name ?
(a) none
(b) $comp
(c) 4compute
(d) 173comp
4. To convert a value of one data type to another data type in an expression which of the following is used
(a) type define
(b) casting
(c) automactic conversion
(d) user defined types
5. Array elements are stored in
(a) Direct memory locations
(b) Sequential memory locations
(c) Scattered memory locations
(d) Random memory location
6. Associativity of arithmetic operators is from
(a) middle to right
(b) right to left
(c) left to right
(d) middle to left
7. Which of the following is used in ‘C’ to indicate logical OR
(a) ||
(b) U
(c) V
(d) |
8. The symbol for exclusive OR operator is:
(a) ^
(b) |
(c) &
(d) _
9. x = 9 - ((12 / 3 ) + 3 * 2 ) - 1 what is the value of x.
(a) 10
(b) 8
(c) -2
(d) 2
10. Which of the following statements would read a single character from the keyboard and place the result in a character
variable ‘ch’ defined as: char ch;
(a) getkeyb ( ch );
(b) printf( “%c”, ch );
(c) while(!kbhit)
(d) ch = getch( );
11. Which one of the following is not a loop control structure.
(a) while
(b) do-while
(c) if
(d) for
12. while(++I <=n);
what is the value of I when the loop completes, if the initial value of I is 1.
(a) n+2
(b) n
(c) n-1
(d) n+1
13. Elements of a string are accessed by a number called as
(a) index
(b) coordinate
(c) label
(d) pointer
14. Dynamic memory allocation in array results in
(a) allocation of memory at file saving time
(b) allocation of memory at compile time
(c) allocation of memory at debugging time
(d) allocation of memory at runtime
15. Which function is used to convert a string of digits into their integer values
(a) atoi
(b) btoi
(c) asctoint
(d) itoa
16. Local variable declared in the ‘main function’ can be used
(a) by the main function only
(b) by a any function as part of the program
(c) by main function and the functions called in it
(d) any where in the program
17. Which of the following statements is correct when an array is passed to a called function
(a) not possible
(b) function-name ( array-name , size )
(c) function-name ( array-name[size])
(d) function-name ( array-name [ ] )
18. What will be the output of the following program
void main ()
{char txt[ ]
=

12345\0
abcdef”;
printf (“%s”, txt);
}
(a) abcdef
(b) 12345
(c) 12345 abcdef
(d) 12345 \ 0abcdef
19. The address operator cannot be applied to variable
(a) static
(b) global
(c) register
(d) auto
20. The header file that must be included at the beginning of a C program to use a library function cos is
(a) math.h
(b) stdlib.h
(c) dos.h
(d) conio.h
C C A B B C A A C D C D A D A A B B C A
1. Pseudo code is
(a) outcome of compilation process
(b) code developed using the syntax of a specific language
(c) refined version of program
(d) language independent code
2. The ANSI C standard recognizes maximum length of a variable up to
(a) 31 characters
(b) unlimited characters
(c) 15 characters
(d) 8 characters
3. The only allowed special character in a variable name is
(a) (under scrore)
(b) ;
(c) ,
(d) :
4. What is the size of long double variable
(a) 16 bytes
(b) 4 bytes
(c) 10 bytes
(d) 8 bytes
5. The declaration of a variable should be done
(a) before using it
(b) after using it
(c) only in the calling program
(d) at the time of using
6. Output of printf(“%f”,3/4) is———
(a) 0.00
(b) gives an error
(c) 0.75
(d) 0
7. Which of the following has highest precedence
(a) ==
(b) +
(c) <
(d) &&
8. Hierarchy decides which operator
(a) operates on large number
(b) consumes more CPU time
(c) is most important
(d) is used first
9. If y is of integer type variable then the two expressions.
3*(y-8)/9 and (y-8)/9*3 yield the same value if
(a) y-8 is an integer multiple of 9
(b) y is an odd number
(c) y is an even number
(d) y-8 is an integer multiple of 3
10. What is the output of the following program
main( )
{ int a=5, i=1; while(i++ (a) 4,3,2,1
(b) 1 1 1 1 1
(c) 5 5 5 5 5
(d) 5,4,3,2,1
11. Which of the following statement is not true about the switch statement
(a) Character constants are automatically converted into integer
(b) No two case statements have identical constants in the same switch
(c) The switch() can evaluate relational or logical expressions
(d) In switch() case statement nested if can be used
12. Output of the following statement is
for (I=0;I<5;I++);
printf(“%d”,I);
(a) 1 2 3 4 5
(b) 5
(c) 1 2 3 4
(d) 0 1 2 3 4
13. Findout which of following is correct array declaraion
(a) int num(25);
(b) int array num[25];
(c) int num[25];
(d) num[25];
14. An array which contains two subscripts, to represent each element is called as
(a) two dimensional
(b) three dimensional
(c) multidimensional
(d) one dimensional
15. What is the control string for representing string
(a) %c
(b) %s
(c) %d
(d) %f
16. A function can be called in a program
(a) Only two times
(b) Only once
(c) Any number of times
(d) Only three times
17. When you pass an array as an argument to a function, what actually gets passed
(a) Address of the array
(b) Values of the elements of the array
(c) Number of elements of the array
(d) Address of the last element of the array
18. What will be the output of the following program?
void main()
{char x[ ]
=
{‘s’, ‘
a’, NULL };
printf (“\n %d”, sizeof (x));
}
(a) 1
(b) 2
(c) 3
(d) 0
19. What is the output of the following program
main()
{static int y;
printf (“%d\n”, y);
}
(a) 0
(b) undefined
(c) compilation error
(d) run-time error
20. #directive must be present
(a) before the main function
(b) any where in the program body
(c) at the end of the program
(d) after the main function
D A A C A A B D A C B B C A B C A C A A
1. The step by step description of a process is called as
(a) flowchart
(b) algorithm
(c) pseudo code
(d) program
2. The constant ‘\00 is called as
(a) nill
(b) full
(c) null
(d) zero
3. Which of the following is not a valid name for a C variable
(a) Hello There
(b) HelloThere
(c) Hellothere
(d) HELLO THERE
4. A character variable can at a time store
(a) a string of 254 characters
(b) 1 character
(c) 2 character
(d) 8 character
5. How many variables of the same type can be initialized at a time with the same value
(a) One
(b) Two
(c) any number of variables
(d) Three
6. What is output of following program ?
main( )
{int x;
x= 4 + 2 % 8;
printf(“%d”,x);
}
(a) 6
(b) -6
(c) 4.25
(d) 4
7. The equality relational operator is represent by
(a) =
(b) :=
(c) .EQ.
(d) ==
8. Among the following operators which operators has the highest priority
(a) Logical OR
(b) Bitwise OR
(c) Logical AND
(d) Bitwise XOR
9. x=9-12/3+3*2-1, what is the value of x
(a) 4
(b) -10
(c) 2
(d) 10
10. The output of the statement printf(“%d”,0xDC ) is
(a) 420
(b) 320
(c) 120
(d) 220
11. switch(ch)
{case ‘a’: printf(“a”);
case ‘b’: printf(“b”);
default: printf(“error”);
} if ch is assigned to the character ‘a’ then the output will be
(a) a
(b) a b error
(c) error
(d) a b
12. count=0;
for ( I=0;I<=10; I++)
{if(I%2==0)
count++;
}printf(“%d”, count);
Pick out the correct value for count.
(a) 4
(b) 6
(c) 3
(d) 5
13. C does no automatic array bound checking. This is
(a) false
(b) Neither advantage nor disadvantage
(c) Disadvantage of C
(d) Advantage of C
14. The number of elements in the array a[10][5] is
(a) 15
(b) 40
(c) 50
(d) 45
15. A string in the ‘C’ language is represented by enclosing a sequence of characters in
(a) double quotes
(b) flower brackets
(c) parenthesis
(d) single quotes
16. The statement used to send back any value to the calling function is
(a) break
(b) continue
(c) exit
(d) return
17. What is the output of
main()
{int x, change (int);
x = 20;
change (x);
printf (“%d”, x);
return 0;
}change (
int x);
{x = 10;
printf (“%d”. x);
}
(a) 20 20
(b) 10 20
(c) 10 10
(d) 10 30
18. What is the type that strlen() funtion will return
(a) float
(b) int
(c) char
(d) long int
19. The global variable can be declared
(a) within block
(b) before main
(c) after main
(d) after block
20. Which of these complier directives access to the print function
(a) #include conio.h;
(b) #include
(c) #define print
(d) include stdio.h;
B C A B C A D D D D B B C C A D B B B B
1. The symbol with rounded ends is used to represent
(a) start/ stop
(b) equation processing
(c) decision making
(d) input/output
2. The function getchar( ) is used to read
(a) a character
(b) a word
(c) a string
(d) a boolean value
3. What are the smallest individual units in a program
(a) Tokens
(b) Structures
(c) Functions
(d) record
4. What is the range of unsigned char data type
(a) 0 to 255
(b) -128 to 127
(c) -32, 768 to 32,767
(d) 0 to 512
5. Which of the following would you use to declare a character array called str large enough to fit the word HELLO
(a) char str[3]
(b) char str[6]
(c) string str;
(d) char str[5]
6. The operator ++ is called as operator
(a) increment
(b) double addition
(c) special increment
(d) decrement
7. In an expression involving ||
||
operator the evaluation
(a) takes place from left to right
(b) will be stopped if one of its components evaluates to false
(c) will be stopped if one of its components evaluates to true
(d) takes place from right to left
8. The effect of shifting a variable to the left by one bit position is
(a) divide it by 2
(b) multiply it by 2
(c) add it by 2
(d) subtract it by 2
9. Which of the following shows the correct hierarchy of arithmetic operations in C
(a) ( ), / or *, - or +
(b) ( ),&&,*or / + or -;
(c) ( ), &&, *,/,+,-
(d) ( ), &&, / , *, +, -
10. Consider the segment
If(1) printf(“yes”);
else printf(“no”);
what will be the output
(a) yes
(b) Unpredictable
(c) Error
(d) no
11. Which of the following statement is not true about the switch statement
(a) Character constants are automatically converted into integer
(b) In switch() case statement nested if can be used
(c) No two case statements have identical constants in the same switch
(d) The switch() can evaluate relational or logical expressions
12. The minimum number of times the for loop is executed is
(a) 0
(b) 1
(c) cannot be predicted
(d) 2
13. The amount of storage required for holding elements of the array depends on
(a) data type
(b) datatype and size
(c) run-time requirement
(d) size
14. If we don’t initialize a static array, what will be the elements set to:
(a) character constant
(b) a floating point number
(c) 0
(d) an undetermined value
15. printf (“\ “ well done\” ”); what will be the output of this statement
(a) “ well done”
(b) \“well done \”
(c) well done
(d) \ well done \
16. The statement used to send back any value to the calling function is
(a) return
(b) continue
(c) break
(d) exit
17. When a function is recursively called, all automatic variables are
(a) stored in an array
(b) stored in a stack
(c) stored in queue
(d) stored in a list
18. What is wrong with the following program
main() { char m1[9]= “message1”; char m2[9]=“message2”; m2=m1;
printf(“msg is %s”,m2); }
(a) char array cannot be printed directly using printf
(b) array is not a left value and so cannot be assigned to
(c) program compiles without error, but prints an unpredictable value
(d) array cannot be initialized as above
19. Variables declared using the register storage class are created in
(a) ROM
(b) hard disk
(c) processor registers
(d) RAM
20. The function sqrt() is part of header file.
(a) conio.h
(b) stdio.h
(c) math.h
(d) iostream.h

A A A A B A C B A A C A B C A A B B C C

1. A compiler compiles the source code
(a) based on language
(b) one line at a time
(c) Complete program at a time
(d) two lines at a time
2. A machine language program consists of instructions written in
(a) 0’s and 1’s
(b) keywords
(c) mnemonics
(d) english like words
3. Among the following which is not a C token
(a) identifiers
(b) comment
(c) strings
(d) constants
4. Range of long int is
(a) -216 to 216 - 1
(b) -231 to 231
(c) -216 to 216
(d) -231 to 231 - 1
5. The real constant in C can be expressed in which of the following forms
(a) ASCII form only
(b) both fractional and Exponential
(c) fractions form only
(d) exponential form only
6. Addition of two numbers is performed using
(a) logical operators
(b) conditional operators
(c) relational operators
(d) arithmetic operators
7. Which of the following is used in ‘C’ to indicate logical OR
(a) U
(b) ||
(c) V
(d) |
8. The symbol for exclusive OR operator is:
(a) _
(b) |
(c) &
(d) ^
9. What is the result of the expression ( 10/3 )*3+5%3 ?
(a) 10
(b) 11
(c) 8
(d) 1
10. What is the output of the following program
Main( )
{ float a;
int x = 6; y = 4;
a = x/y;
print (“%f”,a)
}
(a) 2.0
(b) 1.00
(c) error
(d) 1.5
11. Which one of the following is not a loop control structure.
(a) while
(b) if
(c) do-while
(d) for
12. Identify the loop control structure
(a) if-else
(b) switch
(c) goto
(d) while
13. Array subscripts in ‘C’ always start at
(a) 0
(b) compiler dependent
(c) 1
(d) -1
14. The maximum number of dimension an array can have in C language is
(a) 4
(b) 5
(c) compiler dependent
(d) 3
15. The following function is used to count and return the number of characters in a given string
(a) strcmp()
(b) strlen()
(c) strrev()
(d) strcat()
16. The parameters in a function definition are
(a) real parameters
(b) formal parameters
(c) actual parameters
(d) dummy parameters
17. Which of the following cannot be passed to a function
(a) a constant
(b) a function
(c) a structure
(d) an expression
18. What is the use of the strlen( ) function
(a) string comparison
(b) copies one string into another
(c) finds the length of the string
(d) string concatenation
19. main()
{} int a;
fun1( ) {} fun2( ) {} To which of the above functions, int a is available to
(a) all functions
(b) only fun1( )
(c) both fun1( ) and fun2 ( )
(d) available to neither of the functions
20. Which of the following is a correct way of defining a symbolic constant pie in C
(a) # Define pie 22/7
(b) #define pie= 3.142
(c) # define pie = 22/7
(d) #define pie 22/7
C A B D B D B D B B B D A C B B D C C D
1. What type of errors are checked during compilation
(a) syntax errors
(b) divide by zero error
(c) run - time errors
(d) logical errors
2. The constant ‘\b0 is used for
(a) backspace
(b) tab
(c) bell
(d) vertical blank
3. Which of the following is an incorrect variable name.
(a) else
(b) name
(c) string
(d) age
4. The keyword is used to define a new data type.
(a) union
(b) array
(c) Structure
(d) typedef
5. Which of the following is the assignment operator in C
(a) = =
(b) !=
(c) =
(d) : =
6. What is the result of the expression 15%-2
(a) 0
(b) -1
(c) 1
(d) 7
7. Identify the relational operator in C
(a) !
(b) &&
(c) <
(d) ||
8. The symbol for left shift operator is:
(a) <<<
(b) <<
(c) <=
(d) <
9. In the expression b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first?
(a) 3*c
(b) 2/n
(c) 6.6/a
(d) 2*a
10. Consider scanf(“%2d”, &n); and the input data is 3142 then n will be assigned
(a) 42
(b) 31.42
(c) error
(d) 31
11. Which of the following statement is not true about the switch statement
(a) In switch() case statement nested if can be used
(b) Character constants are automatically converted into integer
(c) The switch() can evaluate relational or logical expressions
(d) No two case statements have identical constants in the same switch
12. The minimum number of times the for loop is executed is
(a) 0
(b) 1
(c) cannot be predicted
(d) 2
13. C does no automatic array bound checking. This is
(a) Neither advantage nor disadvantage
(b) Advantage of C
(c) false
(d) Disadvantage of C
14. In a multidimensional array with initialization
(a) the right most dimension may be omitted
(b) no demension must be omitted
(c) both leftmost and right most may be omitted
(d) the left most dimension may be omitted
15. The following program fragment
int m,n,b; char wer[80]; m=n=b=8;
sprintf(wer,“%d%d%d”,m,n,b);
puts(wer);
(a) prints the string 8 8 8
(b) prints the string 888
(c) prints 888 888 888
(d) prints the null string
16. A function is one that returns no value.
(a) void
(b) Integer
(c) float
(d) recursive
17. What is the output of the following program
void main()
{int x = 2;
sqr(x);
printf(“%d”, x);
}sqr(x)
{int y;
y = x * x;
printf (“%d”, y);
}
(a) 4 4
(b) 2 2
(c) 2 4
(d) 4 2
18. If the first string and the second string both are identical, then strcmp function returns
(a) any positive integer
(b) a value of 1
(c) either 1 or 0
(d) a value of 0
19. int a[10];
What a represents in the following declaration
(a) both name of the array and address of the first element
(b) one character
(c) the address of the first element
(d) name of array
20. The function sqrt() is part of header file.
(a) conio.h
(b) math.h
(c) iostream.h
(d) stdio.h

A A A D C C C B C D D A D D B A D D A B
1. What symbol is used to represent the connector
(a) parellogram
(b) rectangle
(c) rectangle with rounded end
(d) circle
2. Which of the following operators is not used in c
(a) >>
(b) >
(c) X
(d) &
3. How many keywords are there in C
(a) 31
(b) 34
(c) 30
(d) 32
4. Size of (double) returns———
(a) 2
(b) 10
(c) 8
(d) 4
5. Which of the following would you use to declare a character array called str large enough to fit the word HELLO
(a) char str[3]
(b) string str;
(c) char str[6]
(d) char str[5]
6. The operator % yields
(a) quotient value
(b) remainder after integer division
(c) Percentage value
(d) Fractional part
7. What is output of following Program?
main( )
{int x=10,y=5,p,q ;
p= x> 9 ;
q= x > 3 && y != 3 ;
printf( “p=%d q=%d ” ,p,q) ;
}
(a) p = 1 q = 1
(b) p =0 q = 0
(c) p = 1 q= 0
(d) p = 0 q = 1
8. M = 5, Y = M++, After executing these statements the value of M and Y are
(a) M=6, Y=5
(b) M=6, y = 7
(c) M=6, Y=6
(d) M=5, Y=6
9. If y is of integer type variable then the two expressions.
3*(y-8)/9 and (y-8)/9*3 yield the same value if
(a) y is an even number
(b) y is an odd number
(c) y-8 is an integer multiple of 3
(d) y-8 is an integer multiple of 9
10. The values of a,b and c in the statement scanf(“%d%f%c”,&a,&b,&c); if the input stream is 15.75 23 x is
(a) 15 23.00 x
(b) 15 0.75 2
(c) 15 23 x
(d) 15 0.75 x
11. switch(ch)
{case ‘a’: printf(“a”);
case ‘b’: printf(“b”);
default: printf(“error”);
} if ch is assigned to the character ‘a’ then the output will be
(a) a
(b) a b
(c) error
(d) a b error
12. The minimum number of times the for loop is executed is
(a) 2
(b) cannot be predicted
(c) 0
(d) 1
13. What will happen if you put too few elements in an array when you initialize it.
(a) Error at run-time
(b) Error message from the compiler
(c) Possible system malfunction
(d) Unused elements will be filled with 0’s or garbage
14. If we don’t initialize a static array, what will be the elements set to:
(a) a floating point number
(b) 0
(c) an undetermined value
(d) character constant
15. Strings always ends with
(a) null character (‘\00)
(b) semicolon ( ; )
(c) colon ( : )
(d) question mark ( ? )
16. A function can return only value
(a) zero
(b) one
(c) two
(d) three
17. Recursive functions are executed in
(a) last in first out order
(b) distributed fashion
(c) parallel fashion
(d) first in first out order
18. What is the use of strcpy( ) function
(a) finds the length of the string
(b) copies one string into another
(c) string concatenation
(d) string comparison
19. The global variable can be declared
(a) after main
(b) after block
(c) before main
(d) within block
20. #define PI 3.14 is a kind of .
(a) Pre compiler directive
(b) Preprocessor directive
(c) Processor directive
(d) Compiler directive
D C D C C B A A D B D C D B A B A B C B

1. C language has been developed by
(a) Ken Thompson
(b) Martin Richards
(c) Dennis Ritchie
(d) Peter Norton
2. A block is enclosed with pair of
(a) { }
(b) <>
(c) [ ]
(d) ( )
3. Predefined identifiers are called
(a) functions
(b) variables
(c) reserved words
(d) constants
4. What is size of double variable?
(a) 1 byte
(b) 10 Bytes
(c) 4 Bytes
(d) 8 Bytes
5. The declaration of a variable should be done
(a) after using it
(b) only in the calling program
(c) before using it
(d) at the time of using
6. What is the remainder of 8%10?
(a) 8
(b) 2
(c) 0
(d) 1
7. How many logical operators C provides?
(a) 3
(b) 4
(c) 1
(d) 2
8. main( )
{ int a=0; if(a) printf(“%d”,++a); else printf(“%d”, a+=2) ; } the output is
(a) 2
(b) 1
(c) 3
(d) 0
9. What value would be stored in an integer variable “i” as a result of the following calculation:
int i,j; j=3; i=4+2 * j/(j-1);
(a) 7
(b) 6
(c) 1
(d) 8
10. The function putchar( ) uses
(a) one argument
(b) no argument
(c) two argument
(d) any number of arguments
11. Output of the following programs is
main()
{int a,b,c;
scanf( %d %d ”, &a,&b);
if(a>b)
printf(“%d”,a);
else
printf(“%d”,b);
}if input is 10 5
(a) 20
(b) 105
(c) 10
(d) 5
12. Give the output of the following program:
#include < stdio.h >
main()
{int I=1;
while (I < 5)
{printf(“%d”, I);
}}
/* End of Main */
(a) Print the value of I as 1
(b) Warning for no return type for main ( )
(c) Infinite loop
(d) Prints the value of I as11111
13. Output of the below program
#include
main()
{int a,b=0;
int c[10]={1,2,3,4,5,6,7,8,9,0 };
for(a=0;a<10;++a)
b+=c[a];
printf(“%d”,b);
}
(a) 1 3 6 10 15 21 28 32 45 45
(b) 55
(c) 45
(d) 0
14. consider the array definition
int num [10] = { 3 ,3 ,3 };
pick the correct answers
(a) This is syntactically wrong
(b) the value of num[8] is 3
(c) this is invalid if it comes within a function
(d) the value of num[2] is 3
15. Which of the follwing is a string
(a) ‘abcd’
(b) “abcd”
(c) abcd
(d) ‘abcd”
16. Actual and formal parameters must agree in
(a) data types
(b) number of argument and datatypes
(c) names and data type
(d) names and number of arguments
17. output of the following program is
#include< stdio.h>
main()
{int a,count;
int funct( int count);
for( count=1;count<=5;++count)
{a=funct1(count);
printf(“%d”,a);
}}
int funct1(int x)
{int y;
y= x*x;
return(y);
}
(a) 1 4 9 16 25
(b) 25
(c) 36
(d) 25 9 16
18. In the following C-statement, what is the datatype of d and st respectively.
Printf {“\t%.s\n”, d, st);
(a) character, string
(b) digit, string
(c) digit, character
(d) string, string
19. Consider the following program
main()
{int a= 2;
printf(“%d”,a);
modify(a);
printf(“%d”,a);
}void modify(int a)
{a=a*3;
printf(“%d”,a);
return;
}The output of the above program is
(a) 2 6 6
(b) 6 2 6
(c) 6 6 2
(d) 2 6 2
20. #define PI 3.14 is a kind of .
(a) Compiler directive
(b) Preprocessor directive
(c) Processor directive
(d) Pre compiler directive
C A C D C A A A A A C C C D B B A B D B

0 comments:

Copyright © 2008 - JNTU Online Bits - is proudly powered by Blogger
JNTU