Cie
Roll No. .
Total No, of Questions : 9] [Total No. of Printed Pages : 8
(2021)
BCA (CBCS) RUSA Ist Semester
Examination -
4040
C-PROGRAMMING
BCA-0104
-
\ Time : 3 Hours] [Maximum Marks : 70
Ne
\ Note :— Attempt five questions in all, selecting one each
from Unit-I to Unit-IV. Part-A (Q. No. 1) is
. compulsory.
a Part-A
, (Compulsory Question)
ca 1. (A) Multiple Choice Questions :
(i) The type name/reserved word ‘short’ is :
(a) short long
(b) short char
(c) short fleat
(d) short int
C-587 (Ee) Turn Over(ii) To store a word/sentence declare ;
Wn Ss =
Voriable of the type ‘string’.
(a) True
(b) False
(iii) In the given below code, the P, is :
Type def int *ptr;
ptr p!, p?
(a) Integer
(b) Integer pointer
(c) Both integer and integer pointer
(d) None of these
(iv) What will be the output of the following
C code ?
Il. # include
2. int main()
ou
4. int a=1, b=, ce
5. C= att + 4h
ae (2.C-587
(v)
6 PrN (“Sed, oem a,b);
Temi}
(@ a=1b=4]
(b) a=2 b=]
() a=1,b=2
@) a=2,b=2
What will be the Output of the following
C code ?
1. # include
int main()
{
while()
printf (“In while loop”);
printf (“After loop \n”);
}
(a) In while loop after loop
7a a WP YD
(b) After loop
(c) Compile time error
(d) Infinite loop
(3) Turn Overdas :
) C was primarily develope
vi
tem programming language
ysl
(a) S!
age
(b) General purpose languag
(c) Data processing language
(d) None of these
(vii) C programs are converted into machine
language with the help of :
(a) An Editor
(b) A compiler
(c) An operating system
(d) None of these
(viii)In C if you Pass an array as an argument |
to a function, what actually gets passed ?
(a) Value of element in array
(b) First element of the array
(c) Base address of the array(ix) Which header file shoulg
; ei
use functions like mall Mcluded to
loc
) and cal
(a) memory.h Calloc() 2
() stdieb.h
c) string.h
(c) 8 @) dosh
(«) Which of the following i Not logical
al
operator ?
(a) & (bd) &&
() || (a)! 1x10=10
(8) Answer the following in 25 to 50 words :
(i) Why C is called middle level language ?
(ii) Explain the term compilation.
(iii) Differentiate between keywords and
identifiers.
(iv) What is an operator ? List different types
of operators.
(v) Define an array. In what way does an
array differ from an ordinary et
Turn Over
wy
387 (si)Part-B
(Unit-1)
| chart to fing
2, Write an algorithm and draw # flow 1:
(a) ‘The sum of first 50 natural numbers fo
(b) The sum of first 50 add numbers iN
<
Or
3. What are constants, variables and keywords ? Explain
10
by taking suitable examples.
(Unit-I1) 10 cach
4. Write a program to find the reverse of a fiv> digit
number.
Or
5. Write a program to calculate net salary of an employee
if his basic salary is input from keyboard, his DA is
35% of basic, HRA is 15% of the basic, MA is Rs.
250 and his PF is deducted at the rate of 10% of the
Basic Salary (BS) :
Net Salary = BS + DA + HRA + MA - PF
C-587 en(Unit
10 each
write a program to calculate electricity bill f
; 7 ‘Y Oil for the
following conditions :
Minimum charges = 250 if units Cone
are
< = 100
upto 250 units bill is calculated @ 3 per unit for >
100 and < = 250 units
upto 500 units bill is calculated @ 3.75 per unit for
> 250 and < = 500 units
> = 500 units is calculated # 4.50 per unit.
for
Or
7. Write a program to print the following patterns :
ABCDc BA
ABC c BA
AB BA
A A
Turn Over
C587 (7)Wi) 654321
54321
4321
321
21
1
(Unit-IV) 10 each
8. What is a Function ? Differentiate between call by
value and call by reference function. Use appropriate
examples.
Or
9. What are Pointers ? Explain the concept of array of
pointers with the help of appropriate example.