Computer Programming “C Language”
MC0061
Part- A
Q1. C was developed
in the year …………………….
A.1978 B. 1956 C. 1972 D.1980
Q2. Name the inventor of ‘C’ language.
A. dennise ritchi
B. george bool C.
georo d. none
Q3.Which of the following types of operators are used in C ?
A. Asighnment
operator B.Conditional operator
C.Bitwise
operator D.All of these
Q4. what is
true about break statement.
A. breaks a loop B.
to break a function C.to exit from a main function D.none
Q5.For if-else ,if test condition fails then which part will
be executed:
A. if block B.
else block C. next to if –else D. both part of if-else
Q6.The range for integer is …………………to ………………………………………….
- 0-127 B. -32768 to 32767 C. 0-64635 D. None
Q7.Which of the following is an exit –controlled loop in C?
A.for loop B.while loop C.do-while loop D.none
Q8. ‘=’ This sign act as an …………………………………………………………………
- Arthmatic B. Logical C. Assignment D. All
Q9. Write any two preprocessor directives1……………………….2
……………………
- #include ,# define B. #include<stdio.h> ,# include <conio.h> C. conio.h , stdio.h D . none
Q10 Which of the following function reads a line of input
into a string?
A. getstr( ) B.
getch( ) C. gets( ) D.
getchar( )
Q11.Tiek the correct one:-
A \b’ – blank space b ‘\n’ – line return.
C ‘\0’= form feed D ‘\r’= null character
Q12. Function can
a) Return only one
value at a time
b) Return many
values depending on the arguments
c) Both a and b d) none of the above
Q13. which statement is false
(A) printf
(“sum of two nos =%d\n” , sum);
(B) printf
(‘%s, name);
(C) prientf
(“Enter the value of b “, & b);
(D) prientf
(Enter your name “)
Q14. Which is true?
(A) # include <stio.h> (B)
# include <stdio.h>
(C) # include “stdio.h” (D)
# include<math.h>
(A) A, B, C, D (B)
A, C (C) C, B (D) A, B, C
Q15. <Studio.h>is a header file of
(A) String manipulation function (B) Mathematical function
(C) Input/Output function (D)
Standard library funcation
Q16 # Include is used for
(A) To define a macro (B)
to include the content of file
(C) To include undefined macro (D) none
Q17 To display integer value in C, we use
(A) %f (B)
%d (C) %c (D) %s
Q18 which of these is a advantage of Array
(A) data
items stored under single variable name
(B) array
saves the memory space
(C) arrange
the data in particular order
(D) all
of above
Q19 Which operator is used for dereferencing?
(A) à (B)
# (C) & (D)
*
Q20 External variables are
(A) Global (B) local (C)
static (D) None
Q21 Fastest storage
class is
(A)
External storage class (B)
static storage class
(C)
Automatic storage class (D)
Register variable
Q22 Strcat is used to
(A) find
the length of string (B)
concat two string
(C) compare
two strings (D) none
Q23.C is a programming language:-
(A)high
level language ( B)middle level
language(C) lowlevel language
(
D) middle level language
Q24. ?: is which
type of operater?
(A) unary (B) binary (C) ternary (D)none of above
Q25. what is the result of the following program:-
4*(2+2)*3
(A) 16
(B) 32
(C) 20
(D) 48
Q26. what is the value of
A or C after the execution of program:
:
Void
main( )
{
int a,b,c;
b=2;
a=2*(b++)
c=2*(++b).
}
(A)a=4,c=6
(B)a=3,c=8( c)a=3,c=7(D)a=4,c=8
Q27. a variable which holds the memory location of the
variable called:
(A)function
(B)pointer(C)structure(D)array
Q28. A loop that executes the statements at least
once ,even if the condition fails for the first time:-
(A)for (
B)while(C)do-while(d)none of above
Q29. Go to
statement is used for
(A)unconditional jump ( b)conditional branching (c) jump(d) none
Q30 matrix is
called:-
(A)single
dimension array( B)double dimension array(c)both a and b(D)none of above
Q31. In the single dimensional array values are stored
……..with respective range.
(A) Row
wise (B) Column wise (C) Row X Column wise (D) None
Q32. The … is a modular programming concept which consists
of instructions.
(A) Array (B) Function (C) Program (D)
Process
Q33. Declaration of a function before it is used is called .
(A)
Function definition (B) function
prototype
(C) Function declaration (D) None
Q34. C program should be start as…………….
(A) Array (B) Function (C) Structure (D)
None
Q35. The library function getch()
(A) Returns
character when any key is pressed
(B) Returns
a character when enter is pressed
(C) Returns
and displays a character on the screen when any key is pressed
(D) Returns
none of the above
Q36.Choose the right sequence of operators from lowest
precedence to highest.
(A)
++,+,(),+,= (B) +=,+,++,() (C) (),+=,++,+ (D)+=,+,++,()
Q37.In context of the switch statement consider these two
statements
1. Only
one variable is tested.
2. Each
possible value of the variable can control a single branch.
Which of these is true?
(A) 1 (B) 2 (C) both (D) None
Q38.The three statements in for loop parenthesis are in
sequence
(A) Update,
condition, initializes (B)
initialize, condition, update
(C) Condition,
update, initialize (D)
initialize, update, condition
Q39.An external variable is one
(A) which is
globally accessibly by all function
(B) which
is a declare out side the body of any function
(C) which
resides in the mummery till the end of program
(D) all of the
above
Q40.which type of variables is initialized automatically?
(A)
Automatic (B) External (C) Static (D) Register
PART -B
Q41.When the function call by itself is called
(A) Loop (B) Recursion (C) Structure (D) Union
Q42.Preprocessor directives are used in c program
(A) Including
files (B) conditional
compilation
(C) Substitution
of values (D) all the above
Q43. Statements which are executed before the program
complied is called
(A)
Comments (B)
preprocessor directives
(C) Conditional
statements (D) none the above
Q44. The function which returns the keying in characters in
the screen is
(A) getch() (B) getche() (C) getchar() (D)
clrscr()
Q45. Which is not the advantage of pointers?
(A) pointers
are pointing to different data types and structures
(B) to
return single value via function
(C) to
achieve a clarity and simplicity
(D) to
return multiple value via function
Q46.Which statements are true?
1. The
array range starts from zero up to specified final value
2.
Subscript range must be –ve integer content
(A). both are true (B)
1is true (C) 2is true (D) both are false
Q47.which is not a liner data structure?
(A) Array (B) tree (C)
linked list (D) queue
Q48. What is the result of the following program?
Int a= 10;
X=++a+a++;
(A) 21 (B) 22 (C) 20 (D) error
Q49.What is the result of the following program ?
Main()
{
int a ;
a=0;
while (a<10);
{
printf (“\n Value is %d”,a);
a++;
}
getch();
}
(A) It will print 0-10values (B)
it will print 0-9values
(C) Give error (D)
NO result
Q50. which statements are true ?
- C is a structured programming language
- C supports poor set of data types
- C is unstructured programming language
- C supports rich set of data types
(A) 1,2 (B) 1,3,4 (C)
1,4 (D)1,2,3
Q.51.what will be the output of the program .
Main ()
{
care
ch=’m’;
putch
(‘M’);
putch (ch);
putchar
(ch);
(A) mmm (b)
Mmm (C) mmm (d )MmM
Q52.
Which of the following is used
in global variable,
a) extern b) static
c) auto d) all the
above
Q53. What is output
Void main ()
{
char suite = ‘3’
switch (suite)
{
case ‘1’ : printf
(“ Diamond”);
case ‘2’ : printf
(“ spade”)
default : printf
(“Heart”);
}
}
a) Heart b) Diamond c) Spade d) None
Q54.The gets () and
puts () functions are
a) unformatted IO
functions b) formatted IO
functions
c) disk IO function d) none of the above
Q55. ____________ is a self-contained block of
statements that perform a
coherent task of
same kind
a) Package b) Function c) Both a and b d) None of the above
Q56. Preprocessor
commands are known as ______________
a) directive b) directives c) macros d) none of the above
Q.57 A header file
is
a) A file that
contains standard library functions
b) A file that
contains definitions and macros
c) A file that
contains user defined functions
d) A file that is
current working directory
Q58. Every line in
a ‘C’ program should end with a
a) : b) ;
c) . d) none
of these
Q59.What is the
range of unsigned char
a) -128 to 127 b) 0 to 255 c) -255 to 255 d) none of the above
Q60. The output of
print f (“%d”, ‘a’) will be
a) syntax error b) 65 c) 97 d) none of the above
Part -C
Q61. Which of the
following can not be used for return type?
a) void b) float c) double d) none
Q62. What is the
output
Void main ( )
{ int a =30;
fun (a) ;
printf (“%d”, b);
}
a) 60,30 b) 30,50 c) 60,60 d) none
Q63.strncpy ( )
a) copies a string
into another
b) copies first n
character of one string into another
c) copies last n
characters of one string into another
d)none of these
Q64.The members of
structure are by default
a) private b) public c) only a or b d) both a and b
Q65. Recursion is
related to
a) loop b) data types c) none d) functions
Q67.The do_while
loop is
a) top testing b) bottom testing c) both a & b d) none of the above
Q68. If x=5 and y=
x++ and z=++x then what is the value of y and z
a) 5,5 b) 5,6 c) 6,5 d) 6,6
Q69.A string is
termined by a ____ character which is written as ____
a) null, ‘\0’ b) new line ‘\n’ c) both a & b d) none of the above
Q70.Match
the following….
(a)bit
wise AND (a)<<= >>=
(b)bitwise
shift operators (b)&
(c)assignment
operators (c)<< >>
(d)relational
operators (d)=,+=,-=,*=,/=,%=,&=,|=,<<=,>>=
(a)a-b,b-c,c-d,d (b)a-b,b-d,c-b,d-a (c)a-b,b-a,c-d,d (d)a-c,b-a,c-d,d-b
Q71.Match the following….
(a)strcat() (a)compare two string
(b)strcpy() (b)copies a string into another
(c)strlen () (c)append
one string at the end of another
(d)strcmp() (d)find length of string
(a)a-b,b-c.c-d,d-a (b)a-c,b-b,c-d,d-a (c)a-d,b-c,c-b,d-a (d)a-b,b-c,c-a,d-d
Q72.
Tick correct string constant ….
(a)”hello” (b)”1987 (c)”?......!” (d)’5+3’
(a)a,b (b)a,c (c)a,d (d)c,d
Q73.
Classification of function as…
(a)built in (b)user
define function
(c)standard function (d)all of above
Q74.Write true and false…
(a)the
keyword extern is optional in some c compilers.
( )
(b)binary
operators use two operands. ( )
(c)unary
operator use a single operands ( )
(d)ternary operator use two operands. (
)
Q75.Match the following….
(a)int
or signed int (a)0 to
4,294,967,295
(b)unsigned
int (b)-2,147,483,648 to 2,147,483,647
(c)long
int or signed long int (c)0 to 65535
(d)unsigned
long int (d)-32,768 to
32,767
No comments:
Post a Comment