0% found this document useful (0 votes)
56 views13 pages

Pic Pyq

The document contains examination papers for the subject 'Introduction to Programming' in C, covering various topics such as keywords, identifiers, data types, loops, operators, algorithms, and file handling. It includes questions for mid-term and end-term examinations from different years, requiring students to demonstrate their understanding of programming concepts through coding tasks and theoretical explanations. The structure of the exams includes compulsory questions and options for students to choose from, emphasizing practical programming skills and theoretical knowledge.

Uploaded by

ronakgupta332005
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)
56 views13 pages

Pic Pyq

The document contains examination papers for the subject 'Introduction to Programming' in C, covering various topics such as keywords, identifiers, data types, loops, operators, algorithms, and file handling. It includes questions for mid-term and end-term examinations from different years, requiring students to demonstrate their understanding of programming concepts through coding tasks and theoretical explanations. The structure of the exams includes compulsory questions and options for students to choose from, emphasizing practical programming skills and theoretical knowledge.

Uploaded by

ronakgupta332005
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/ 13

(PYQ-2023)

STUDY MATERIAL

PROGRAMMING
IN C
(Please Write your
our Roli Roll No.
No. immediately)

Mid Term Examination


B. Tech- Semester: Il February, 2019
Paper.Code: ETCS 108 Subject: Introduction to Programming
Time: 1 % Hour Maximum Marks: 30

OTeQuestion No. 1 is compulsory. Attempt any two more questions from the rest.
Q 1.Answer the following:
[2x5 10]
a) Differentiate between a keyword and an identifier with examples. List the criteria
of declaring an identifier.
b) Write the steps involved from sample.c to
sample.exe.
c) What would be appropriate data type to store the following:-
i) Distance among the galaxies ii) Factorial of a 2-digit number
iii) an exclamation mark () iv) average agebf student in your class.
d) Define precedence and associativity of operators with examples.
e) What is a header file? List any three header files with their
purpose.
Q2. a) Describe various operators with the help of suitable examples.
b) Write the output of the following statements. All are integer values. [1 x5-5].
i=8;j=7; j + =i * i printf(%%d", j);

i=j=k=1; printf(%d", G+2) % k/(i + 1);


ii) i-9; j=14; k=6;
iv) a=5<=8&& 6 =5;
((i%4)*6+G-2)/(k+3)) = ?
printf(%d", a);
v) -
10 %-3 =?
Q3. a) What is the purpose of loops in programming? Differentiate between various
loops with the help of examples.

b) Write a program to find numbers and their sum between 100 to 1000 which are
divisible by 7.

Q4. a) What is a switch statement? List its disadvantages. Write a program using switch
statement.
b) Define break and continue statements with example. (3
What is the purpose of getchar() and putchar)?
C) [2
Exam Roll No. . **************
Please write your Exam Roll No.)

END TERM EXAMINATION


SECOND SEMESTER [B.TECH.]MAY-JUNE-2014
Subfect: Introduction to Programming
Paper Code: ETCs108
(Batch: 2004-2012)
Maximum Marks :75
TYme:3 Hours ve questions including Q.no.1 uwhich is compulsory.
Note: Attempt any j unit.
Select one questlon from each
Perform subtraction and l's Complement method. You have to
using 2"s
Q1(a)
find M-N, M=101000100 and N=00110010.

(b) Explain the design flow to solve the problem. flow Diagram?
(c) What is the difference between the Flow chart and Data
codes?
(d) What is the difference between ASCII and EBCDIC
included in C
(e) What is an Operator? Discuss different types of operator
language with an example for each. (5x5-25)

UNIT-I
Define Algorithm. Write the characteristic features and format of algorithm.
Q2
Discuss the technique used to design an algorithm. (12.5)
Define Flowchart. Write the advantage and symbols used in flowchart. Draw the
Q3
Flowchart to find the smallest of 3 numbers. (12.5)

UNIT-II
What do you mean by the terms Precedence and Associatively? Write a program
Q4 to find the roots of a Quadratic Equation? Find the roots for the cases when
determinant D>0, D=0 and D<0. (12.5)

What is the difference between Formatted Console 1/0 Function


and
Q5 (a)
Unformatted Console I/O Functions? (6)
How many times will "for loop" be executed? Compare with the "While
(b) a
Loop" and the "Do-while Loop", (6.5)

Unit-III )
Entry Controlled Loop and Exist Controlled Loop in C programs. 6
Q6 (a) Describe
(b) Write a program in C, which can print the following: (6.5)

1 2 3 4 3 21
Mention the return types in function. By default a function returns which
Q7 (a)
type of a value? Give an example. (6)
(b) Describe Format Argument, Actual Argument, Function Declaration and
Function Definition. (6.5)

UNIT-IV
Q8 Explain the following:
(a Static Memory Allocation and Dynamic Memory Allocation. (3)
(b) Call by Value and Call by Reference. (3)
(c) Comparison between an array of char and a pointer to char. 3.5)
(d) Structure and union. (3)

Q9 (a) Differentiate betweena Pointer to Constant and a Constant Pointer. (4)


(b) Write C program to sort a list of strings in alphabetical order. (8.5)
************

P
(Please write your Exam Roll
No.) Exam Roll No.********
... *
END TERM EXAMINATION
SECOND SEMESTER B.TECH]MAY -JUNE 2019
Paper Code: ETCS-108 Subject: Introduction to Programmingg
(Batch 2013 Onwards)
Time: 3 Hours
Maximum Marks: 75
Note: Attempt any five questions incuding Qno.1 which is
compulsory.
Q1 Differentiate between the following (any
(a) Ternary and Bitwise operator. five): (5x5-25)
(b) External and Internal documentation.
(c) Primitive and Non Primitive data types.
(d) Loader and Linker
(e) Declaration and Definition of a variable.
() Auto, Register, static and Extern variables.
Q2 (a) Explain how strings can be stored using a multidimensional arrays?{5)
(b) Differentiate between break and continue. Write a C program to
the pattern. print
(7.5)

03 (a) Explain actual and formal parameters with example..(5)a


(b) Distinguish between an array of structures and an array within
structure. (5)
(c) What is dangling pointer? What precaution should be taken to avoid
it? (2.5)
Q4 (a) Explain argument passing using pointers.
(b) Explain preprocessor directives with examples.
(c) What is self referential structure? (3)
d) Define token with example. (2.5)

Q5 (a) Write a C program to compare contents of two files. (6)


(b) Differentiate between text mode and binary mode in file handling. (3)
(c) Differentiate between append and write mode. (3.5)

Q6 (a) Explain storage classes available in C. (6.5)


(b) Draw a flow chart to count the number vowels in a string of
characters. (6)

Q7 (a) Distinguish between user defined function and build-in functions.(4.5)


(bWrite aC program that dynamically allocates an integer, initializes the
integer with a value, increment it, and then print the incremented
value. (4)
(c) Differentiate between sequential and random access files. (4)

Q8 (a) What is type casting? Explain with example. (6)


(b) Explain nested looping with example. (3.5)
(c) Write aC program to search an element in an array. (3)

***********

P
Please write your roll no. immediately.
First Term Examination
Second Semester(B.Tech)

Paper Code :ETCS- 108 Feb 2018

Paper Name :Introduction to Programming Time: 1.30Hrs

Max. Marks :30

Note: Q. No.1 is Compulsory and Attempt


anytwo questions out of the remaining questions
Q.1 (a) Explain the difference between an identifier and a keyword.
(b) What do you mean by the term precedence and Associativity?

(c) What is a characteristic of an Algorithm?

(d) What purpose is served by break statement &where it is used?

e) Why it is necessary to use '&' sign before a variable name in scanf function?
(2+2+2+2+2=10)
Q.2 Write an algorithm to generate Fibonacci series and draw the flowchart for the same.

(5+5-10)
Q.3 What is the output of the following program? (3+3+4=10)

(a) void main() (b}main() (c) void main()


fint a =8654;
inti, j=10; int a=10; Printf("%d\n",a);
For(; i=;j-=2) A-a++a- Printfl"%3d\n",a);
Printf("%d", ii Printf("%d\n",a); Printf("%6d\n",a);
Printf("9%5d\n",a);
Printf("%04d\n",a};

a.4(a write a program to accept any six digit number and print the sum of all even digits ofthat
number and multiplication of odd digits.

(b) Draw the pattern

1
23
4 56
7 8 9 10
11 12 13 14 15 (5+5)
Exam Roll No. ..e**** * * * * e * * * * * *

(Please write your Exam Roll No.)

END TERM EXAMINATION


SECOND SEMESTER [B.TECH]MAY- JUNE 2018to
Paper Code: ETCS-108 Subject: Introduction Programming
Maximum Marks: 75
Time: 3 Hours Batch 2o3 onLord)
which is compulsory.
Note: Attempt any five questions ineluding Q.No1
(5x5-25)
Answer the following:- differ from break
How does continue statement
Define break statement.
(a)
statement?
and five in-
function? List its characteristics and
name
(b) What is meant by
built functions with their purpose. between
Is there any relation
(c) Describe the various phases of compilations.
directives? Justify your answer.
compilation and pre processor structure with
between and structure. Define an array of
(d) Differentiate array
an example.
Define associativity of operators. Write the output of the following
(e
statements. All are integer values.
i) i-3; j =7 i* 2*j' printf"%d", i'
i ) i=j = k = 3; printf%d", (i+5)% j+2)/k};
algorithm for
characteristics. Write an
Q2 (a) Define an algorithm and list its (6)
5 liter and 3 liter jugs are available.
measuring 4 liter of water if only from time error and
error differ run
(b What is logical error? How does logical
answer with examples. (6.5)
syntax error? Support your
(6)
Q3 (a) Describe storages classes in C with suitable examples. has the
C language. Which operator
(b) Describe various operators used in
(6.5)
highest precedence?
of first n odd numbers.(4)
program to print the
sum
Q4 (a) Using the for loop, write a
write a program that prints the
factorial of n. (4)
(b) Using the do-while loop, the digits n. (4.5)
the while statement, write a program that reverses
(c) Using
with the help of suitable
(a) Describe the methods of parameter passing
Q5 6)
examples. recursive
by recursion? Write a program using a
(b) What do you mean
(6.5)
function.
needed? Explain with an example. 6)
(a) What are pointers? Why are they
Q6 Give two matrices A[ ] xr
and A
m [| r x n . Write a program to
calculate product
(b) that: 6.5)
of two mnatrices such
C]mxn =A[|mxr *B|]rxn
record. Also determine size of this
Declare a structure for employee
Q7 (a) (6)
structure.
Define a random access file. What are the various operations commonly
(b) Discuss with examples. (6.5)
used in file handling?

Write short notes following with


on the the help of examples:
Q8 (4)
(a) Argument passing using pointers (4)
(b) Array of pointer
(4.5)
(c) Call by reference
w******

You might also like