For More Question Papers Visit - www.pediawikiblog.com
1sPCD13
USN
First Semester B.E" Degree Examination, Programming in G ad Data Stnuctures Tirne: 3 hrs.
m
Max. Marks: 80
co
Note: Answer any FIVE full questions, choosing one full question from each module.
g.
a.Whatisvariable?Explaintherules.,.ffivariablesinClanguage'Giveexampies for valid and invalid variables. Evaluate the following expressions : i) 100% 20 <: 20 - 5 + l00oh l0*20: : 5 > : 1 !: 20 ii) a+: b *: c-: 5 where a: 3 b : 5 and c : 8. Write a C program to find the area and perimeter of a rectangle.
L U.
lo
()
o0
(t
o.
!
C.
d
ib
.o
OF
.. x v b+c b-c
od a2
$ts
a:4; b:5; x:bla;
/6 d!=
'-^ ,o o!
i6 l+: 6C !o
3 a.
a:4;
b=5;
x:
(float) b/a ;
C '-c
ot)
6=
b.
4 a.
=lJ :o VL
o
w
U<
(05 Marks)
Module-2
Explain the syntax of do-while statement. Write a C program to find the factorial of a (08 &Iarks) number using do-while, where the number n is entered by user. What is two way selection statement? Explain if, if else, and cascaded if-else with examples. (08 Marks)
w w
6.v >\(E
(04 Marks)
d
.p
6X tro.
:
c
What is value of "x" in following code segments? Justifiz your answel's: i)inta,b; ii) int a, b ; float x ; float x;
C.
o; 6p
o.!
b-a
ed
Eei
b(ad+e)
(06 Marks)
w
b.
ik
result. Convert the following mathematicalexpression into C expressions
ia
!o EO
(04 Marks) (06 Marks)
OR Write a C program which takes as input p, t, r. Compute the simple interest and display the
2a.
'=
(06 Marks)
b.
OR Write a C program that takes from user an arithmetic operator ('*', '-','*' or '/') and two operands. Perform the corresponding arithmetic operation on the operands using srvitch
statement.
What is an array? How to declare and initialize the two dimensional
ar:ray?
(08 Marks) (08 Marks)
_N ()
z
o c.
t
5 a. b. c.
Module-3 What is a function? Write a C program to find the cube of a number using function. (05 Marks)
Write a C program to check a number is a prime or not using recursion. (05 Marks) Write a program to replace each constant in a string with the next one except letter "z' 'Z' oa', 'A'. and Thus the string "programming in C is fun" should be modified as "Qsphsannjoh jo D jt gvo" (06 Marks) l of 2
For More Question Papers Visit - www.pediawikiblog.com
For More Question Papers Visit - www.pediawikiblog.com 15PCD13
6 a. b.
OR Write a C program to sort the elements by passing affay as function argument. (08 Marks) Write a C program to concatenate two strings without using built - in function strcat( ).
Module-4
c.
OR
L U.
10 a. b.
lo
using pointer. What is stack? Explain its operations with examples.
oR. Write a C program to swap two numbers using call by address. Explain any five preprocessor diregtives in C. What are primitive and non-primitive data types? Explain with examples.
w
w w
.p
ed
ia
L.
(08 Marks) (08 Marks)
Module-5 What is a pointer? Write a C program to find the sum and mean of ail elements in an affay
Write a C program to store and print name, USN, subject and IA marks of students using
w
8 a.
(05 Marks) (07 Marks)
co
b.
g.
la.
What is structure? Explain the C syntax of structure declaration with example. Write a C program to pass structure variable as function argument. Explain fopen( ) and fclose( ) functions.
m
(08 Marks)
2 of2
For More Question Papers Visit - www.pediawikiblog.com
Programming in C & Data Structures Jan 2016 - 2015 Scheme.pdf ...
Programming in G ad Data ... Write a C program which takes as input p, t, r. ... Displaying Programming in C & Data Structures Jan 2016 - 2015 Scheme.pdf.
Write a C++ program using class and explain public, private, object, class. Explain ftier:id function and friend class, with exarnple. (10 Marks). (10 Marks).
i) # define square(x) x * x. void main( ) ... Describe hase class access control with an example. b. ... Displaying Programming in C++ Jan 2016 (2010 Scheme).pdf.
Page 1 of 4. Scanned by CamScanner. Page 1 of 4. Page 2 of 4. Scanned by CamScanner. Page 2 of 4. Page 3 of 4. Scanned by CamScanner. Page 3 of 4. 2015-CA 2B 02-PROGRAMMING IN C++ AND DATA STRUCTURES.pdf. 2015-CA 2B 02-PROGRAMMING IN C++ AND DATA STR
count( ) return 0 or 1. reserve( ) set the number of buckets. size(). empty(). Nota: hash_table is a very efficient data structure but elements can not be ordered. - -.