0% found this document useful (0 votes)
67 views6 pages

Adobe Scan 29 Nov 2024

Uploaded by

olnymobile963
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views6 pages

Adobe Scan 29 Nov 2024

Uploaded by

olnymobile963
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

SOLVED MODEL QUESTION PAPER 1 - As Per 2024 Pattern

Fundamentals of Programming Languages (ESC-105-COM]


F.E. (Common to AIIBranches) Semester - I(End Sem)

Time:2;1 Hours) [Maximum Marks: 70

Instructions to the candidates :


) 0. No. 1is compulsory. Solve Q. No. 2or Q. No. 3, Q. No. 4or Q. No. 5, Q. No. 6or Q. No. 7,
Q. No. 8 or Q. No. 9, Q. No. 10 or Q. No. 11.
2) Neat diagrams must be drawn wherever necessary.
3) Figures to the right indicates full marks.
4 Assumne suitable data, if necessary.
Q.1 Multiple Choice Questions (1 Mark each) [10]
a) The pictorial representation of an algorithm is called
a) pseudocode b) flowchart c) diagram d) chart
Ans.: b) flowchart
b) scanf) can be used for reading.
a) character b) integer c)float d) all of these
Ans. : d) all of these

c) Which of the following operations produce an 1, if the input bits are 1 and 1 ?
a) or b) and c) exclusive nor d) all of these
Ans.: d) all of these
if.
d) Ify is of integer type then the expressions 3 *(y-8)/7 and (y -8)17 *3 give the same value
a) y is an even number b) y is an odd number
c)y-8 is an integral multiple of 7 d)y-8 is an integral multiple of3
Ans.: c)y-8 is an integral multiple of 7
e) Break statement can be used for
a) switch statement b) while c) for d) all above
Ans.: d) all above
) The following program fragment
for (i =1;i<6; ++i)
if (i==2) continue;
else printf"%d", i);
results in the printing of
a) 1 24 5 b) 1 34 5 c) 3 4 5 d) none of the above
Ans. : b) 1345

(M-1)
M-2 Solved Model Question Papers
Fundamentals of Programming Languages
g) Array subscripts in Calways start at
a)-1 b) 1 c) 0 d) value provided by user
Ans. : c) 0
h) Consider the statement
int val [2] [4] =(1, 2, 3, 4, 5, 6, 7, 8);
4 willbe the value of
b) val [0] [4] c) val [1] [1] d) val [0] (3]
a) val [1] [4]
Ans.: d) val [0] [3]
Consider the function
find (int p, int q)
Ireturn ((p<)?0:(p-q)):}
gives
Let a, b be tuo non-negative integers. The call find (a, find (a, b))
d) minimum of a, b
a) maximum of a, b b) positive difference of a, b c) sum of a, b
Ans. : d) minimum of a, b

) Consider the following program


main ()

char x [10), "ptr =x;


scanf ("%s", x ;
part (&x[4);

part (char al ] )
(putslal :)
fabcdefg is the input, the output will be
a) abcd b) abc c) efg d) garbage
Ans. : c) efg
Describe various data types in C. (Refer section 2.6) [6]
Q2 a)
b) What are the differences between constant and variable ? (Refer section 2.6) [3]

c) Construct aflowchart and write an algorithm to print first N Fibonacci numbers. (Refer example 1.3.16) [3]

OR

03 a) What do you mean by 'C' Tokens ? (Refer section 2.6) [3]

b) Write short notes on : Register storage clas. (Refer section 2.7) I3]

c) Write an algorithm and flowchart to find largest of thre mumbers. (Refer example 1.3.3) [6]

a) Describe various types of operators supported by C. (Refer section 4.1) [31

b) Describe the conditional operator in C. (Refer section 4.7) [6]


c) What do you mean by left to right as8ociativity and right to left associativity ? (Refer section 4.11) [3]

OR
[3
) Discuss the working modulo operator. (Refer section 4.2)
TECHNICAL PUBLICATIONS. an up-thrust for knowledge
Fundamentals of Programming Languages M-3 Solved Model Question Papers

b) Explain the difrent types of unary operators used in Cwith necessary program. (Refer section 4.6) 16]

c) State various trigonometric functions supported by C. (Refer section 4.12) I3]


Q.6 a) Explain the ifelse ladder state with the help of example. (Refer section 5.5) I3]

b) Compare 'for, 'while' and 'do-while' loops. (Refer section 5.13) [3]

c) Write a C program to accept a student's marks for frve subjects, and compute his/her result. Student is passing if
helshe scores marks equal to and above 40 in each course. If the student scores aggregate greater than 75 %, then
the grade is distinguished. If an aggregate is 60>= and <75 then the grade of the first division. If an aggregate is
50= and <60, then the grade is second division. If an aggregate is 40>= and <50, then the grade is third division.
(Refer Lab program 6) [6]

OR
[6]
Q.7 a) Explain switch case statement with suitable example. (Refer section 5.6)
(3]
b) What is the purpose of break statement ? (Referf section 5.11)
5.14) I3]
c) Differentiate break and continue statement in Cprogramming language. (Refer section
order using bubble sort method.
Q.8 a) Write a C program to sort the array in the ascending [6]
(Refer example 6.8.1)
[6]
(Refer section 6.6)
b) Explain the various string handling functions.
OR
[3]
elements. (Refer example 6.4.6)
Q.9 a) Write a Cprogram to find the average of array
declare and initialize a two-dimensional array in C?
b) What is a two-dimensional array and how to (3]
(Refer section 6.5)
[6]
string. (Refer example 6.7.5)
c) Write a Cprogram to reverse the
recursion function.
Write a Cprogram to calculate factorial ofa given number using [6]
Q.10 a)
(Refer example 7.8.1) [3]
section 7.9)
and lifetime of variables. (Refer
[6] b) Write a note on the scope, visibility [31
array ? (Refer section 8.2)
(31 How does a structure differ from an
OR
[3]
storing details (Name, Designation,
Gender, Date of
structure EMPLOYEE for
a) Write a C
program that creates a structure.
a11
data and update the data in the
[31
Joining and Salary), and store the [6]
(Refer Lab Program 9)
arguments.
[31
argument ? Differentiate between formal arguments and actual 13
[6] b) What is
(Refer section 7.6) I3)
(31 ? (Refer section 8.2)
How is an array ofstructures initialized
c)
[6]
[31

[31
up-thrust for knowiedge
TECHNICAL PUBLICATIONS- an
SOLVED MODEL QUESTION PAPER 2 - As Per 2024 Patterm
[ESC-105-COM]
Fundamentals of Programming Languages Sem)
Semester - I (End
F.E. (Common to All Branches)

Time:2;Hours)
IMaximum Marks:70
Q.1 Multiple Cholce Questions (1 Mark each)
a) The rule for implicit type conversion is
a) int < unsigned <float <double b) unsigned < int <float < double
c) int <unsigned <double <float d) unsigned < int < double <float
Ans. : a) int < unsigned < float < double
b) The output of the following is
int a = 75;
printf ("%d%%", a);
b) 75 %% c) 75 % d)) none of the above
a) 75
Ans. : c) 75 %
then
c) If the bit pattern corresponding to a signed integer is shifted to the right
a) vacant bit will be filled by the sign bit b) vacant bit will be filled by 0
c) the outcome is implementation dependent d) none of the above
Ans. : a) vacant bit will be filled by the sign bit
(ob?6:8)); printf"%d"A}
d) What will be the output ofthe followingstatements ? int a=5,b=6,c=9,d; d=(b>a?(oc?1:2):
a) 1 b) 2 c)6 d) 8
Ans. : b) 2
e) Consider the following program statements
if (a>b)
if (b<c)
statement 1;
else statement 2;
statement 2 will be executed if.
a) a<= b b) b<c c) b<= c and a <=b d) a> b and b >=c
Ans.: d) a>band b>c
9 The following program fragment
for (i - 1;i<6; ++i)
if(i2) continue;
else printf("%d", i);
results in the printing of.
a) 1245 b) 1345 c) 345 d) none of the ab0ve
Ans.: b) 1345

(M-4)
Fundamentals of Programming Languages M-5
Solved Model Question Papers
a) Which standard library string
function is used to find first occurrence of a given character in
a) strstr b) strchar c) strrchar
another string ?
d) strrstr
Ans. : a) strstr
h) What will be the output of the following code?
int arr[] = (10, 20, 30, 40, 50};
printf("%d", arr(2);
70 a) 10 b) 20 c) 30 d) 40
Ans. : c) 30
i) When you pass an array as an argument to function what actually gets passed?
a) Number of elements of array b) Values of the elements of array
c) Address of first element d) All of these
Ans.: c) Address of first element
) With every use of a memory allocation function, what function should be used to release allocated memory which is no
longer needed ?
a) unalloc) b) dropmem() c) dealloc() a) freel)
Ans. : d) free()
Q.2 a) Explain the basic structure of C program. (Refer section 2.4) [3]
of constants in
b) What are constants ? What are the ways to declare constants in C language ? Describe different types
detail. (Refer section 2.6) [6]
(Refer example 1.3.12) (3]
c) Write an algorithm and draw flowchart to find the sum of array elements.
OR
(3]
are they useful ? (Refer section 2.5)
Q.3 a) What do you mean by trigraph charkcters ? How
d"d): [6]
(Refer section 2.7)
b) Write notes on storage classes in C.
and average of 3 numbers. (Refer example 1.3.4)
[3]
c) Draw aflowchart and write an algorithm to find sum 4.3)
in Cwith necessary program. (Refer section
Q4 a) Explain the different types of relational operators used [6]
operators in 'C. (Refer section 4.8)
b) Discuss about bitwise operators and logical
associativity of unary operators ? (Refer section 4.11)
c) What is meant by associativity ? What is the
OR
(41
assignment operator. (Refer section 4.5)
a) State the important points regarding [3]
(Refer section 4.6)
b) Describe the cast operator in C. 4.12) (5]
commonly used mathematicalfunctions. (Refer section
c) List anyfive 5.4)
else problem. How can it be solved ? (Refer section
a) Explain the darling use of goto statement ? (Refer
section 5.7)
statement ? Why we should avoid the
b) What is the purpose of goto
working modulo operator. (Refer section 4.2)
c) Discuss the
OR

? (Refer section
5.3)
nested-ifstatement section 5.8)
Q.7 a) What is
looping ? diferentforms of looping. (Refer
Describe two
b) What is meant by
for knowledge
TECHNICAL PUBLICATIONSan up-thrust
Fündamentals of Programming Languages M-6
©) Write a Cprogram to Solved Model
reverse the digits of given integer number.
Q.8
a) Write a Cprogram to find min (Refer example 5.13.2) Question Papersers
element in the array. (Refer example 6.4.4)
b) Name any two library
functions used for string handling. (Refer section 6.6) [3
C) Write a C program to
concatenating wo string. (Refer example 6.7.4) 3

Q.9 OR
a) Write a C program to perform
matrix addition. (Refer example 6.5.2)
b) Write a program to find the
Q.10
transpose for a matrix. (Refer example 6.5.4)
) What is the need for
functions ? (Refer section 7.1) [6
b) Explain the concept of referencing the whole [3
structure with the help of example. (Refer section 8.4)
c) Write a C program to reverse a [6
string using recursion. (Refer example 7.8.5)
[3
OR
a.11 a) Discuss about call by value and call by
reference with illustrations.(Refer section 7.6)
b) Write a C program to create [6
structure STORE to keep track of Products (Product Code,
menu of allproducts to users. Generate bills as per order. Name and price). Dslnu
(Refer Lab program 10)

O00

TECHNICAL PUBLICATIONGan up-thrust for knowedge

You might also like