PARUL UNIVERSITY-IT-COMPUTER SCIENCE(BCA)
Computer Programming with C
Multiple Choice Questions-
1) The C language consists of number
of keywords.
A] 32
B] 40
C] 24
D] 56
2) Which of the following is a keyword used for a
storage class?
A] Printf
B] external
C] auto
D] scanf
3) Which operator has the lowest
priority ?
A] ++
B] %
C] +
D] ||
4) Which pair of functions below are used for single
character I/O ?
A] getchar() and putchar()
B] scanf() and
printf() C] input()
and output() D]
Non of these
5) What is the
outputof this
program ?
void main() {
int
a=b=c=10;
a=b=c=50;
printf(\n %d %d
%d,a,b,c); } A] 50 50
50
B] Compile Time Error
C] 10 10 10
D] Three Gaebage Value
6) What will be the output of the following
program? Void main ( ) {
PARUL UNIVERSITY-IT-COMPUTER SCIENCE(BCA)
Double
x=28; Int r;
R= x%5;
Printf (\n r=%d,
r); } A] r= 3
B] Run time Error
C]Compile time Error
D]None of the Above
7) What the follwing function call
mean? Strcpy(s1 , s2 );
A]copies s1 string into s2
B]copies s2 string into s1
C]copies both s1 and s2
D] None of these
8) What will be the output of the following
program? Void main( ) {
Int x []= {10,20,30,40,50};
Print f ( \n %d %d %d %d , x [4] ,3[x] ,x[2]
,1[x] ,x[0] ); } A] Error
B] 10 20 30 40 50
C] 50 40 30 20 10
D]None of these
9) Which of the following is not s
keyword of C ? A] auto
B] register
C] int
D] function
10) Explicit type conversion is known as
A]
conversion
B]
disjunction
C] separation
D] casting
11) By default a function returns a value of type
A] int
B] char
C] void
D] None of these
12) What will be the value of x after executing the program ?
void main ( ) {
int x;
x = printf(I See, Sea in C);
printf(\n x= % d ,
x); } A] x= 15
B] x=2
C] Garbage value
PARUL UNIVERSITY-IT-COMPUTER SCIENCE(BCA)
D] Err
13) Which is valid string function ?
A] strpbrk B] strlen C] strxfrm D] strcut
14) What will be the size of following
structure? Struct sample {
Static int x;
inty,z; } ;
A]6 bytes B] 2 bytes C] + bytes D] None of these
15) What will be the output ?
void main ( ) {
printf(%d,B < A ); }
A] Error B] 1 C] 0 D] None of these
16) int **x;
A]x is a pointer to pointer B] x is not pointer
C] x is long D] None of these
17) Which of the following is used as a string
termination character ? A] 0 B] \0 C] /0 D] None of
these
18) What will be the output ?
void main ( ) {
int I= 48;
printf(\n %c %d ,I,I ); }
A] Error B] 48 48 C] 1 48 D] 0 48
19) Find out on which line no .you will
get an error ? Line 1: void main ( )
Line 2: {
Line 3: print(\n Hello
World) Line 4: }
A] Line 1 B] Line 2 C] Line 3 D] Line 4
20) What will be the output of the following program ?
void main ( ) {
int x=10,y=20;
printf (\n %d,x,y); }
A] 10 B] 20 C] 10 20 D] None of these
21) Which function reallocates memory ?
A] realloc B] alloc C] malloc D] None of these
22) What will be the size of following union
declaration? Union Test {
Int x;
Char y;
Float z; } ;
A] 7 bytes B] 4bytes C] 1byte D] 4 bytes
PARUL UNIVERSITY-IT-COMPUTER SCIENCE(BCA)
23) what will be the output ?
void main(){
char *p=Hello world;
int *q;
p++;
q = (int *)p;
q++;
printf(\n %s\n
%s,p,q); } A] ello
world B]Error
Ello world
C] ello world D]ello world
Lo world llo world
24) The associativity of !operator is
A] Right to Left B] Left to Right C] (a) for Arithmetic and (b) for Relational
D] (a) for Relational and (b) for Arithmetic
25) Which of the following statements is true?
A] C Library functions provide I/O facilities B] C inherent I/O
facilities
C] C doesnt have I/O facilities D] Both (a) and (c)
26) Which among the following is a unconditional
control structure
A] do-while B] if-else C] goto
D] for
27) In C, a Union is
A ] memory location B] memory store C] memory
screen D] None of these
28) A multidimensional array can be expressed
in terms of A] array of pointers rather than as
pointers to a group of contiguous array
B] array without the group of contiguous array
C] data type arrays
D] None of these
29) A pointer to a pointer in a form of
A] multiple indirection B] a chain of pointers C]
both a and b D] None of these
30) Pointers are of
A] integer data type B] character data type C]
unsigned integer data types
D] None of these
PARUL UNIVERSITY-IT-COMPUTER SCIENCE(BCA)
31) If the size of the array is less than the number
of initializers then,
A ] Extra values are being ignored
B ] Generates an error message
C ] Size of Array is increased
D ] Size is neglected when values are given
32) A Structure
A ] can be read as a single entityB ] cannot be read as a single entity
C ] can be displayed as a single entity
D ] has member variables that cannot be read individually
33) Identify the invalid pointer arithmetic
A] Addition of float value to a pointer
B] Comparision of pointers that do not point to the
element of the same array
C] Subtracting an integer from a pointer
D] Assigning the value 0 to a pointer variable
One line Short qus:=
1. What is variable?
2. What is constant?
3. How many bytes are required to store integer type value?
4. What is global variable?
5. What is language processor?
6. Which are logical Operators?
7. What is the use of getchar() function?
8. Give syntax of simple nested if else stmt?
9. Define Array
10. Give general Syntax to declare two dimensional array
11. What is function?
12. What is built in function?
13. What is use of return statement?
14. What is recursive function?
15. What do you mean by call by value?
16. What do you mean by call by reference?
17. What is pointer?
18. What is structure?
19. What is main difference between structure and union?
20. What is preprocessor
3 marks Questions
1. Enlist the features of C.
2. Explain different data types used in C language?
3. What is data type explain the any four data types used in C language?
4. Explain the difference between = and == operator explain with
example?
PARUL UNIVERSITY-IT-COMPUTER SCIENCE(BCA)
5. Write short note on Input & Output functions used in C (i.e. print &scanf
functions?
6. Differentiate between local variable and global variable?
7. Explain the following g
functions a. i)getch()
and ii) clrscr()
8. Explain continue and break statements with the help of example.
.
9. What is array? How to declare array?Explain with suitable example.
10. What is the difference between call by value and call by Reference?
11. Explain Automatic , Static and register storage classs.
12. Explain Extern storage class.
13. What is function ?how function is defined.
14. Explain the difference between calling function and called function?
Explain void function?
15. Explain how to access a value using pointer?give a suitable example.
16. Write a short note on pointer to pointer
17. What is advantage of representing an array of string by an array of
pointer to string.
18What is null string ?What is its length?
5 marks long qus.:=
1 Explain in brief structure of C programming?
2. What is operator enlist all operators used in C?
3. Write a short note precedence & order of evaluation?
4. Explain any two bitwise operator with suitable example.Explain with
example ++i and i++.
5. Expalin one dimensional array with an example
6. Explain Two dimensional array with an example.Explain applications of
array.
7. What is recursion explain with suitable example
8. Explain what is pointer?expalin with suitable example. Explain pointer
to structure in detail.
9 .What is swaping? Explain it with suitable program without using third
variable.
10. List out the advantages of function. What is mean by call by reference
& call by value.?
. 11. What is the function and list out advantages and disadvantages of
functions?What is
mean by function argument, function call and
return value?
.
12 Explain array of pointers.With exmple
PARUL UNIVERSITY-IT-COMPUTER SCIENCE(BCA)
13 Explain pointer to function in detail.
14 What is structure?explain with suitable example. Explain array of
structure with example
Explain Nested structure with
example.
15 Explain the following functions with example
1)getchar() 2)putchar()