0% found this document useful (0 votes)
20 views290 pages

5CS4-02 Compiler Design Course File Neha Mathur

The document is a course file for Compiler Design (5CS4-02) at Swami Keshvanand Institute of Technology for the academic year 2022-23. It outlines the institute's vision, mission, quality policy, course prerequisites, syllabus, and teaching methodologies, along with a detailed course plan and evaluation criteria. Additionally, it includes lists of required and reference textbooks, as well as mapping of course outcomes to program outcomes.

Uploaded by

b210426
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)
20 views290 pages

5CS4-02 Compiler Design Course File Neha Mathur

The document is a course file for Compiler Design (5CS4-02) at Swami Keshvanand Institute of Technology for the academic year 2022-23. It outlines the institute's vision, mission, quality policy, course prerequisites, syllabus, and teaching methodologies, along with a detailed course plan and evaluation criteria. Additionally, it includes lists of required and reference textbooks, as well as mapping of course outcomes to program outcomes.

Uploaded by

b210426
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/ 290

Swami Keshvanand Institute of Technology, Management & Gramothan,

Ramnagaria, Jagatpura, Jaipur-302017, INDIA


Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

A
Course File
on
(Compiler Design: 5CS4-02)

Program: Bachelor of Technology


Year/Semester: III Year (V Sem.)
(Common For All Branches)
Session: 2022-23

(Neha Mathur)
(Assistant Professor)
(Computer Science & Engineering)

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Contents

1. Institute Vision/Mission/Quality Policy


2. Departmental Vision/Mission
3. RTU Scheme & Syllabus
4. Prerequisite of Course
5. List of Text and Reference Books
6. Time Table
7. Syllabus Deployment: Course Plan & Coverage*
8. PO/PSO-Indicator-Competency
9. COs Competency Level
10.CO-PO-PSO Mapping Using Performance Indicators(PIs)
11.CO-PO-PSO Mapping: Formulation & Justification
12.Attainment Level (Internal Assessment)
13.Learning Levels of Students Through Marks Obtained in 1st Unit Test/Quiz
14.Planning for Remedial Classes for Average/Below Average Students
15.Teaching-Learning Methodology
16.RTU Papers (Previous Years)
17.Mid Term Papers (Mapping with Bloom’s Taxonomy & COs)
18.Tutorial Sheets (with EMD Analysis)**
19.Technical Quiz Papers
20.Assignments (As Per RTU QP Format)
21.Details of Efforts Made to Fill Gap Between COs and POs (Expert
Lecture/Workshop/Seminar/Extra Coverage in Lab etc.)
22.Course Notes

Note:

1.*1st lecture of the course should cover prerequisite


2. **E: Easy, M: Moderate, D: Difficult
3. Format for Points 8-11 should be referred from AICTE’s Recommendations for
Examination Reforms

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Institute Vision/Mission/Quality Policy

Vision:
“To promote higher learning in technology and industrial research to make our country a global player.”

Mission:
“To promote quality education, training and research in the field of engineering by establishing effective
interface with industry and to encourage the faculty to undertake industry sponsored projects for the
students.”

Quality Policy
We are committed to ‘achievement of quality’ as an integral part of our institutional policy by continuous
self-evaluation and striving to improve ourselves.

Institute would pursue quality in

o All its endeavors like admissions, teaching- learning processes, examinations, extra and co-
curricular activities, industry institution interaction, research & development, continuing
education, and consultancy.
o Functional areas like teaching departments, Training & Placement Cell, library,
administrative office, accounts office, hostels, canteen, security services, transport,
maintenance section and all other services.”

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Vision and Mission of CSE Department

Vision of CSE department is to:

V1: Produce quality computer engineers trained in the latest tools and technologies.
V2: Be a leading department in the region and country by imparting in-depth knowledge to the students in
an emerging technologies in computer science & engineering.

Mission of CSE department is to:

Delivering resources in IT enable domain through:


M1: Effective Industry interaction and project based learning.
M2: Motivating our students for employability, entrepreneurship, research and higher education.
M3: Providing excellent engineering skills in a state-of-the-art infrastructure.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

RTU Scheme & Syllabus

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Prerequisite of Course

1. A Programming Language Course C, C++, Java, etc.


2. Other desired background: knowledge of automata theory, context-free languages, computer architecture,
data structures and simple graph algorithms, logic or algebra.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

List of Text Books

1. Aho, Alfred V., Ravi Sethi and Jeffrey D. Ullman, “Compilers, principles, techniques.”, Addison Wesley 7,
no.8 (1986):9, Pearson Education.

2. Sunitha, K.V.N, Compiler Construction, Pearson Education, India,2013.

3. Appel, Andrew W.Modern Compiler Implementation in C, Cambridge University Press, 2004

4. Kakde, O.G. , Comprehensive Compiler Design, Laxmi Publications, 2005.

5. ESL., ITL., Principles of Compiler Design, Pearson Education India, 2012.

6. V Raghvan, “Principles of Compiler Design”, TMH, 2011.

7. Kenneth Louden, “Compiler Construction”, Cengage Learning, 1997.

8. Charles Fischer and Richard LeBlane, “Crafting a Compiler with C”, Pearson Education.

List of Reference Books

1. Srikant, Y.N., and Priti Shankar, eds. The Compiler design handbook: optimizations and Machine

code generation. CRC Press, 2018

2. Mogensen, Torben Egidius, Introduction to Compiler Design, Springer, 2017.

3. Grune, Dick, et al. Modern Compiler Design, Springer Science & Business Media, 2012.

4. K. Muneeswaran, “Compiler Design, First Edition, Oxford University Press, 2012.

5. J.P.Bennet, “Introduction to Compiler Techniques”, Second Edition, Tata McGraw-Hill,2003.

6. Henk Alblas and Albert Nymeyer, “Practice and Principles of Compiler Building with C”, PHI,

2001

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Syllabus Deployment: Course Plan & Coverage*


Faculty: - JNC Subject: - Compiler Design (5CS4-02)
Schedule per week Examination Time : 3 Hours
Lectures: 3 Evaluation: Max Marks: 100 [IA: (30) +ETE: (120)]
Lecture
Units Contents of the Subject Total
No.
I 1 Introduction: Objective, Scope and Outcome of the Course 01
Introduction: Compiler, Translator, Interpreter definitions,
II 2 01
Bootstrapping
3 Phases of Compiler 01
4-5 Review of Finite Automata Lexical Analyzer 02
6 Input, Recognition of tokens 01
7 Idea about LEX: A lexical analyzer generator, Error handling. 01
III 8-9 Review of CFG Ambiguity of grammars: Introduction to parsing. 02
10-11 Top down parsing, LL grammars & passers error handling of LL parser 02
12 Recursive descent parsing predictive parsers, Bottom-up parsing 01
13 Shift reduce parsing, LR parsers, Construction of SLR 01
14-15 Conical LR & LALR parsing tables, parsing with ambiguous grammar 02
16 Operator precedence parsing 01
Introduction of automatic parser generator: YACC error handling in LR 01
17
parsers.
IV Syntax directed definitions: Construction of syntax trees, S- Attributed 01
18
Definition
19 L-attributed definitions, Top down translation 01
20-21 Intermediate code forms using postfix notation, DAG 02
22-23 Three address code, TAC for various control structures 02
24-25 Representing TAC using triples and quadruples 02
26-27 Boolean expression and control structures 02
V 28-29 Storage organization: Storage allocation 02
30 Strategies, Activation records 01
31-32 Accessing local and non-local names in a block structured language 02
33 Parameters passing, Symbol table organization 01
34-35 Data structures used in symbol tables. 02
Definition of basic block control flow graphs: DAG representation of
36 01
VI basic block,
37 Advantages of DAG, Sources of optimization 01
38 Loop optimization, Idea about global data flow analysis 01
39-40 Loop invariant computation, Peephole optimization 02
41 Issues in design of code generator, A simple code generator 01
42 Code generation from DAG 01
Page |
TOTAL LECTURES 42
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Coverage
SUBJECT:………………………………. BRANCH:……………. SEMESTER:………………….

Lecture No. Date Coverage

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Lecture No. Date Coverage

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

PO/PSO INDICATOR COMPTENCY

Program Outcome/Program
Indicator Statement
Specific Outcome

Apply mathematical techniques such as calculus, linear algebra, and


1.1.1
statistics to solve problems

PO 1: Engineering knowledge: Apply advanced mathematical techniques to model and solve


1.1.2
Apply the knowledge of computer science & engineering problems
mathematics, science, engineering
1.2.1 Apply laws of natural science to an engineering problem
fundamentals, and an engineering
specialisation for the solution of Apply fundamental engineering concepts to solve engineering
complex engineering problems. 1.3.1
problems

Apply computer science & engineering concepts to solve engineering


1.4.1
problems.

2.1.1 Articulate problem statements and identify objectives

Identify engineering systems, variables, and parameters to solve the


2.1.2
problems

Identify the mathematical, engineering and other relevant


2.1.3
knowledge that applies to a given problem
PO 2: Problem analysis: Identify,
formulate, research literature, and 2.2.1 Reframe complex problems into interconnected sub-problems
analyse complex engineering 2.2.2 problems Identify, assemble and evaluate information
problems reaching substantiated
conclusions using first principles of Identify existing processes/solution methods for solving the
mathematics, natural sciences, and 2.2.3 problem, including forming justified approximations and
engineering sciences. assumptions

Compare and contrast alternative solution processes to select the


2.2.4
best process.

Combine scientific principles and engineering concepts to formulate


2.3.1 model/s (mathematical or otherwise) of a system or process that is
appropriate in terms of applicability and required accuracy.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
Identify assumptions (mathematical and physical) necessary to
2.3.2
allow modeling of a system at the level of accuracy required.

Apply engineering mathematics and computations to solve


2.4.1
mathematical models

Produce and validate results through skilful use of contemporary


2.4.2
engineering tools and models

Identify sources of error in the solution process, and limitations of


2.4.3
the solution.

Extract desired understanding and conclusions consistent with


2.4.4 objectives and limitations of the analysis

3.1.1 Recognize that need analysis is key to good problem definition

3.1.2 Elicit and document, engineering requirements from stakeholders

Synthesize engineering requirements from a review of the state-of-


3.1.3
the-art

Extract engineering requirements from relevant engineering Codes


3.1.4
and Standards such as IEEE, ACM, ISO etc.
PO 3: Design/Development of
Solutions: Design solutions for Explore and synthesize engineering requirements considering
3.1.5
complex engineering problems and health, safety risks, environmental, cultural and societal issues
design system components or
Determine design objectives, functional requirements and arrive at
processes that meet the specified 3.1.6
specifications
needs with appropriate
consideration for public health and Apply formal idea generation tools to develop multiple engineering
safety, and cultural, societal, and 3.2.1
design solutions
environmental considerations.
3.2.2 Build models/prototypes to develop diverse set of design solutions

3.2.3 Identify suitable criteria for evaluation of alternate design solutions

Apply formal decision making tools to select optimal engineering


3.3.1
design solutions for further development

Consult with domain experts and stakeholders to select candidate


3.3.2
engineering design solution for further development

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
Refine a conceptual design into a detailed design within the existing
3.4.1
constraints (of the resources)

Generate information through appropriate tests to improve or revise


3.4.2
design

Define a problem, its scope and importance for purposes of


4.1.1
investigation

Examine the relevant methods, tools and techniques of experiment


4.1.2 design, system calibration, data acquisition, analysis and
presentation

Apply appropriate instrumentation and/or software tools to make


4.1.3
measurements of physical quantities

Establish a relationship between measured data and underlying


4.1.4
PO 4: Conduct investigations of physical principles.
complex problems: Use research-
based knowledge and research Design and develop experimental approach, specify appropriate
4.2.1
methods including design of equipment and procedures
experiments, analysis and Understand the importance of statistical design of experiments and
interpretation of data, and synthesis 4.2.2 choose an appropriate experimental design plan based on the study
of the information to provide valid objectives
conclusions.
Use appropriate procedures, tools, and techniques to conduct
4.3.1
experiments and collect data

Analyze data for trends and correlations, stating possible errors and
4.3.2
limitations

Represent data (in tabular and/or graphical forms) so as to facilitate


4.3.3
analysis and explanation of the data, and drawing of conclusions

Synthesize information and knowledge about the problem from the


4.3.4
raw data to reach appropriate conclusions

PO 5: Modern tool usage: Create, Identify modern engineering tools, techniques and resources for
5.1.1
select, and apply appropriate engineering activities
techniques, resources, and modern
Create/adapt/modify/extend tools and techniques to solve
engineering and IT tools including 5.1.2
engineering problems
prediction and modeling to complex

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
engineering activities with an Identify the strengths and limitations of tools for (i) acquiring
understanding of the limitations. 5.2.1 information, (ii) modelling and simulating, (iii) monitoring system
performance, and (iv) creating engineering designs.

5.2.2 Demonstrate proficiency in using discipline specific tools

5.3.1 Discuss limitations and validate tools, techniques and resources

Verify the credibility of results from tool use with reference to the
5.3.2
accuracy and limitations, and the assumptions inherent in their use.

PO 6: The engineer and society: Identify and describe various engineering roles; particularly as
Apply reasoning informed by the 6.1.1 pertains to protection of the public and public interest at global,
contextual knowledge to assess regional and local level
societal, health, safety, legal, and
cultural issues and the consequent Interpret legislation, regulations, codes, and standards relevant to
responsibilities relevant to the 6.2.1 your discipline and explain its contribution to the protection of the
professional engineering practice. public

Identify risks/impacts in the life-cycle of an engineering product or


7.1.1
activity
PO 7: Environment and
sustainability: Understand the Understand the relationship between the technical, socio economic
impact of the professional 7.1.2
and environmental dimensions of sustainability
engineering solutions in societal and
environmental contexts, and 7.2.1 Describe management techniques for sustainable development
demonstrate the knowledge of, and
Apply principles of preventive engineering and sustainable
need for sustainable development.
7.2.2 development to an engineering activity or product relevant to the
discipline

PO 8: Ethics: Apply ethical Identify situations of unethical professional conduct and propose
8.1.1
principles and commit to ethical alternatives
professional ethics and
8.2.1 Identify tenets of the ASME professional code of ethics
responsibilities and norms of the
engineering practice. 8.2.2 Examine and apply moral & ethical principles to known case studies

Recognize a variety of working and learning preferences; appreciate


PO 9: Individual and team work: 9.1.1
the value of diversity on a team
Function effectively as an individual,
and as a member or leader in Implement the norms of practice (e.g. rules, roles, charters, agendas,
9.1.2
diverse teams, and in etc.) of effective team work, to accomplish a goal.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
multidisciplinary settings. Demonstrate effective communication, problem solving, conflict
9.2.1
resolution and leadership skills

9.2.2 Treat other team members respectfully

9.2.3 Listen to other members

9.2.4 Maintain composure in difficult situations

Present results as a team, with smooth integration of contributions


9.3.1
from all individual efforts

Read, understand and interpret technical and non-technical


10.1.1
information

Produce clear, well-constructed, and well- supported written


10.1.2
engineering documents
PO 10: Communication:
Communicate effectively on complex 10.1.3 Create flow in a document or presentation
engineering activities with the
engineering community and with the Listen to and comprehend information, instructions, and viewpoints
10.2.1
society at large, such as, being able of others
to comprehend and write effective
reports and design documentation, Deliver effective oral presentations to technical and non- technical
10.2.2
make effective presentations, and audiences
give and receive clear instructions.
Create engineering-standard figures, reports and drawings to
10.3.1
complement writing and presentations

Use a variety of media effectively to convey a message in a document


10.3.2
or a presentation

Describe various economic and financial costs/benefits of an


11.1.1
engineering activity
PO 11: Project management and
Analyze different forms of financial statements to evaluate the
finance: Demonstrate knowledge 11.1.2
financial status of an engineering project
and understanding of the
engineering and management Analyze and select the most appropriate proposal based on
principles and apply these to one’s 11.2.1
economic and financial considerations.
own work, as a member and leader
in a team, to manage projects and in Identify the tasks required to complete an engineering activity, and
11.3.1
multidisciplinary environments. the resources required to complete the tasks.

11.3.2
Use project management tools to schedule an engineering project so
Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
it is completed on time and on budget.

Describe the rationale for requirement for continuing professional


12.1.1
development

Identify deficiencies or gaps in knowledge and demonstrate an


12.1.2
ability to source information to close this gap
PO 12: Life-long learning:
Recognise the need for, and have the Identify historic points of technological advance in engineering that
preparation and ability to engage in 12.2.1
required practitioners to seek education in order to stay current
independent and life-long learning
in the broadest context of Recognize the need and be able to clearly explain why it is vitally
12.2.2
technological change. important to keep current regarding new developments in your field

Source and comprehend technical literature and other credible


12.3.1
sources of information

Analyze sourced technical and popular information for feasibility,


12.3.2
viability, sustainability, etc.

PSO1: Core Engineering Skills: Possess the concepts of Data Structure and Database Management
PSO1.1.1
Acquire basic concepts of Data System
Structures, Databases, Operating
Systems, Computer Network, Theory Possess the concepts of core engineering subjects including
PSO1.1.2
of Computation, Advanced Operating System, Computer Networks and Software Engineering.
Programming and Software
Engineering. PSO1.1.3 Apply basic programming skills to solve real world problems

PSO2: Standard Software Apply fundamental software engineering concepts to solve real
PSO2.1.1
Engineering practices: world problem
Demonstrate an ability to design,
develop, test, debug, deploy, analyse, Possess conceptual knowledge for designing, analysing and testing a
PSO2.1.2
troubleshoot, maintain, and secure software.
mobile applications and software
solutions for automation PSO2.1.3
applications. Estimate and evaluate the cost related to a Software

PSO3: Project Endeavours: Recognise the need and feasibility of project and apply standard
PSO3.1.1
Provide a platform for students to practices for software project development
develop new and innovative projects Identify the functional and non-functional requirement of current
as per current industry needs. PSO3.1.2
industry trends.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
Recognise the challenges of changing trends and career
PSO3.1.3
opportunities as per current industry needs.

CO’S COMPETENCY LEVEL

Bloom’s Taxonomy
Level Descriptor Level of Attainment Keywords

List, define, tell, describe, recite, recall,


1 Remembering Recalling from memory identify, show, label, tabulate, quote, name,
who, when, where, etc.

describe, explain, paraphrase, restate,


associate, contrast, summarize,
2 Understanding Explaining ideas or concepts differentiate interpret, discuss

Calculate, predict, apply, solve, illustrate,


Using information in another use, demonstrate, determine, model,
3 Applying familiar situation experiment, show, examine, modify

Breaking information into parts


to explore understandings and classify, outline, break down, categorize,
4 analysing relationships analyze, diagram, illustrate, infer, select

assess, decide, choose, rank, grade, test,


measure, defend, recommend, convince,
Justifying a decision or course select, judge, support, conclude, argue,
5 Evaluating of action justify, compare, summarize, evaluate

Design, formulate, build, invent, create,


Generating new ideas, products compose, generate, derive, modify,
6 Creating or views to do things develop, integrate

** It may be noted that some of the verbs in the above table are associated with multiple Bloom’s
Taxonomy level. These verbs are actions that could apply to different activities. We need to keep in
mind that it’s the skill, action or activity we need out students to demonstrate that will determine the
contextual meaning of the verb used in the assessment question.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Learning Levels of Students Through Marks Obtained in 1st Unit Test/Quiz

Section

Exam Appeared Exam Below 40% 40%-59.99% 60%-80% Above 80%


I Mid Term Exam
II Mid Term Exam
Final

Average students: 40%-59.99%


Below Average students: Below 40%

Section

Exam Appeared Exam Below 40% 40%-59.99% 60%-80% Above 80%


I Mid Term Exam
II Mid Term Exam
Final

Average students: 40%-59.99%


Below Average students: Below 40%

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Planning for Remedial Classes for Average/Below Average Students

In addition with the syllabus, following topics will be discussed again/separately for average students

1. RTU papers of previous year.


2. Different assignment and Quiz.
3. Problem solving classes.
4. Online study material (PPT, Lecture notes and video lectures) SKIT repository.
5. Motivated students to join InfoSys Springboard and MOOCS Courses.
6. Paper solution discussed in Classroom
7. Revision of important topics.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Teaching-Learning Methodology
➢ Lectures

➢ Self Study

➢ Power Point Presentation

➢ Topic wise Video

➢ Assignment/Quiz/Test

➢ Demonstrations

➢ Problem Solving

Large Group Small Group Individual

- Lecture - Group Discussion - Self Study

- Power Point
- Problem Solving - Assignment/Test
Presentation

-Topic wise Video - Demonstrations - Quiz

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

RTU Papers (Previous Years)

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Mid Term Papers (Mapping with Bloom’s Taxonomy & COs)


Analysis of Question Paper Mid Term: II Examination-2020-21
Branch : AI,CS,ME Semester/session: I Sem./ Group-1 Max Marks: 20
A. Distribution of Course Outcome and Bloom’s Taxonomy in Question Paper
Q. No. Questions Marks CO BL

What is pointer in C? Write a program in C to find


Q1 1 3, 4, 5 2, 3, 4, 5, 6
largest element in an array using pointer.

In given arrays char x[10] , and char x1[10]; what is


Q2 difference between 1 5 3, 6
Part A (All)

(i) x = x1; (ii) x = = x1, and (iii) strcpy(x,x1);

Q3 Differentiate structure and union. 1 5 3, 6

Q4 What are file opening modes? 1 5 3, 6

Q5 What is array of strings? 1 5 3, 6

Write a C program to concatenate one string with


another string without using string handling function,
Q1 4 3, 4, 5 2, 3, 4, 5, 6
also count the number of characters which are
Part B (Any Two)

concatenated to first string.

Write a program and draw the flow chart to calculate


Q2 4 1, 3, 4 2, 3, 4, 5, 6
sum of squares of first N even numbers.

Write short note on the following functions.


Q3 4 5 3, 6
(a) fopen ( ) (b) fclose ( ) (c) fgetc ( ) (d) fputc ( )

Write a C program to read contents of a file (one word at


Q1 7 3, 4, 5 2, 3, 4, 5, 6
a time) and store each word in an array of string.
Part C (Any One)

Define a structure for a state consisting of following


members: name of the state, population of the state and
Q2 literacy rate of the state. Write a C program to read the 7 3, 4, 5 2, 3, 4, 5, 6
data for three states using array of structure and display
the state whose literacy rate is highest.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

BL – Bloom’s Taxonomy Levels


(1- Remembering, 2- Understanding, 3 – Applying, 4 – Analyzing, 5 – Evaluating, 6 - Creating)
CO – Course Outcomes

B. Questions and Course Outcomes (COs) Mapping in terms of correlation

Part A Part B Part C


COs
Q1 Q2 Q3 Q4 Q5 Q1 Q2 Q3 Q1 Q2

CO1 - - - - - 3 - - -

CO2 - - - - - - - - - -

CO3 1 - - - - 1 2 - 1 1

CO4 1 - - - - 1 2 - 1 1

CO5 3 3 3 3 3 3 - 3 3 3

1-Low Correlation; 2- Moderate Correlation; 3- Substantial Correlation

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
C. Mapping of Bloom’s Level and Course Outcomes with Question Paper

Bloom’s Level Mapping

Bloom’s
Percentage
Level

BL1 0%

BL2 7%

BL3 7%

BL4 20%

BL5 20%

BL6 46%

CO Mapping

CO Percentage

CO1 7%

CO2 0%

CO3 20%

CO4 20%

CO5 53%

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Analysis of Question Paper Mid Term: III Examination-2020-21


Branch : AI,CS,ME Semester/session: I Sem./ Group-1 Max Marks: 50

A. Distribution of Course Outcome and Bloom’s Taxonomy in Question Paper


Q. No. Questions Marks CO BL

Draw a flow chart to check a given number is prime or


Q1 10 CO1 2, 6
not.

Perform the following operations:


i) (17E.F6)16=(?)2
Q2 ii) (2F.C4)16 = (?)8 10 CO2 1
iii) (11011)2 - (1110)2 using 2’s complement.
iv) Find 15’s complement for (83D.9F)16
Q3 Explain different operators of C programming language. 10 CO3 2, 3, 6

What is looping statement? Explain different types of


Q4 loop available in C. Write a program to find reverse of a 10 CO4 3, 4, 5, 6
given number.

Explain function declaration, function definition and


function calling with a suitable example. Provide the
definition for the function declaration given below to
Q5 10 CO5 3, 6
copy a string into another string.

void strcpy ( char * , char *);

BL – Bloom’s Taxonomy Levels


(1- Remembering, 2- Understanding, 3 – Applying, 4 – Analyzing, 5 – Evaluating, 6 - Creating)

CO – Course Outcomes

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

B. Questions and Course Outcomes (COs) Mapping in terms of correlation

COs
Q1 Q2 Q3 Q4 Q5

CO1 3 - - - -

CO2 - 3 - - -

CO3 - - 3 - -

CO4 - - - 3 -

CO5 - - - - 3

1-Low Correlation; 2- Moderate Correlation; 3- Substantial Correlation

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

C. Mapping of Bloom’s Level and Course Outcomes with Question Paper

Bloom’s Level Mapping

Bloom’s
Percentage
Level

BL1 7%

BL2 20%

BL3 20%

BL4 7%

BL5 7%

BL6 39%

CO Mapping

CO Percentage

CO1 20%

CO2 20%

CO3 20%

CO4 20%

CO5 20%

Analysis of Question Paper Mid Term: I Examination-2019-20

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
Branch : IT,EC,CE,EE Semester/session: II Sem/ 2Group Max Marks: 20

A. Distribution of Course Outcome and Bloom’s Taxonomy in Question Paper


Q. No. Questions Marks CO BL

Differentiate between high level and low level


Q1 2 1 2
language.
Part A (All)

What is the difference between increment and


Q2 2 3 3
decrement operators?

Q3 Write the syntax of switch case. 2 4 1

Explain the importance of flowchart in


Q1 4 1 3
programming with an example.
Part B (Any Two)

Write a program which demonstrate the use of break


Q2 4 4 4
and continue statements.

Write a program to check the input number is prime


Q3 4 4 3
or not.
Part C (Any One)

Write a program to find the frequency of a given


Q1 6 5 3
number in an one dimensional array.

Q2 Write the program to draw the various patterns. 6 4 2

BL – Bloom’s Taxonomy Levels


(1- Remembering, 2- Understanding, 3 – Applying, 4 – Analyzing, 5 – Evaluating, 6 - Creating)

CO – Course Outcomes

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
B. Questions and Course Outcomes (COs) Mapping in terms of correlation

Part A Part B Part C


COs
Q1 Q2 Q3 Q1 Q2 Q3 Q1 Q2

CO1 2 - - 3 - - - -

CO2 - - - - - - - -

CO3 - 1 - - - - - -

CO4 - - 2 - 1 2 - 2

CO5 - - - - - - 2 -

1-Low Correlation; 2- Moderate Correlation; 3- Substantial Correlation

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
C. Mapping of Bloom’s Level and Course Outcomes with Question Paper

Bloom’s Level Mapping

Bloom’s
Percentage
Level

BL1 7%

BL2 26%

BL3 53%

BL4 14%

BL5 0%

BL6 0%

CO Mapping

CO Percentage

CO1 20%

CO2 0%

CO3 7%

CO4 53%

CO5 20%

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Technical Quiz Papers

SKIT, Jaipur }
PPS: QUIZ
(a)0 0 0 0 (b) Garbage Garbage Garbage
Student Name: Garbage
Branch: (c) 102 56 -80 32 (d) 102 102 -90 64 (e)
Contact No.: Compiler error
Email_id:
4. char* myFunc (char *ptr ){
Note: There is no negative marking ptr += 3; return (ptr);
Time Duration: 1 hour }
int main(){
1. What will be output if you will compile and char *x, *y;
execute the following c code? x = "HELLO";
void main (){ y = myFunc (x);
int i=0; printf ("y = %s \n", y);
if (i==0) { return 0;
i=((5,(i=3)),i=1); }
printf ("%d",i); What will print when the sample code above is
} else printf ("equal"); executed?
}
(a) 5 (b) 3 (c) 1 a) y = HELLO b) y = ELLO c) y =
(d) equal (e) None of above LLO d) y = LO e) x = O

2. What will be output if you will compile and 5. char *ptr;


execute the following c code? char myString [] = "abcdefg";
int extern x; ptr = myString;
void main (){ ptr += 5;
printf ("%d", x); What string does ptr point to in the sample code
x=2; above?
getch (); a) fg b) efg c)
} defg d) cdefg e)
int x=23; None of the above

(a) 0 (b) 2 (c) 23 6. If n has the value 3, then the statement


(d) Compiler error (e) None of these a[++n]=n++;

3. What will be output if you will compile and a) Assigns 3 to a[5] b) assigns 4 to a[5]
execute the following c code? c) assigns 4 to a[4] d) unpredictable result
void main (){
int i; 7. If x is an integer then the value of &x[i] is
float a=5.2; same as:
char *ptr; a) &x[i-1]+ sizeof (int) b)
ptr=(char *)&a; x+sizeof(int)*(i+1) c) x+i d)
for (i=0;i<=3;i++) x+sizeof(int)*(i-1)
printf ("%d ",*ptr++);
Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
8. main (){ 12. Consider the following C-program:
int a=5,b=2; void foo (int n, int sum ){
printf(“%d”,a+++b); int k = 0, j = 0;
} if (n==0) return;
What will be the output of following program? k = n % 10; j = n / 10;
a) Results in syntax error b) 7 sum = sum + k;
c) 8 d) 9 foo (j, sum);
printf (“%d,”, k);
9. main (){ }
int i=5; int main (){
i=(++i)/(i++); int a = 2048, sum = 0;
printf(“%d”,i); foo (a, sum);
} printf (“%d\n”, sum);
What will be the output of following program? }
a) 2 b) 5 What does the above program print?
c) 6 d) 1 a) 8, 4, 0, 2, 14 b) 8, 4, 0, 2, 0
c) 2, 0, 4, 8, 14 d) 2, 0, 4, 8, 0
10. Consider the C program shown below.
#define print(x) printf (“%d “, x) 13. Consider the following C function:
int x; int f(int n){
void Q(int z) { static int r = 0;
z += x; print(z); if (n <= 0) return 1;
} if (n > 3){
void P(int *y) { r = n;
int x = *y+2; return f(n-2)+2;
Q(x); *y = x-1; }
print(x); return f(n-1)+r;
} }
main (void) { What is the value of f(5) ?
x = 5; a) 5 b) 7 c) 9 d) 18
P (&x)
print(x); 14. What is printed by the following C program?
} int f (int x, int *py, int **ppz)
The output of this program is {
a) 1 2 7 6 b) 22 12 11 int y, z;
c) 1 4 6 6 d) 7 6 6 **ppz +=1; z= **ppz;
*py +=2; y= *py;
11. Consider the following C function: x+= 3;
int f(int n){ return x+y+z;
static int i = 1 }
if (n >=5) return n; void main ()
n = n+i; {
i++; int c, *b, **a;
return f(n); c= 4; b= &c; a= &b;
} printf (“%d", f(c,b, a)) ;
The value returned by f (1) is }
a) 5 b) 6 c) 7 d) 8 a) 18 b) 19
c) 21 d) 22

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
return * a + f(a +1,n -1);
15. Consider the program below: else return * a- f(a +1, n- 1);
int fun(int n, int * f_p) { }
int t, f; int main ( ){
if (n <= 1) int a[ ] ={12, 7, 13, 4, 11, 6};
{ pr intf ("%d", f(a,6));
* f_p = 1; return 1; return 0;
} }
t = fun (n- 1, f_p);
f = t+ * f_p; a)-9 b) 5 c)15 d) 19
* f_p = t;
return f; Consider the following c code segment:
} int a, b,c=0;
int main () { void prtFun(void);
int x = 15; main (){
printf ("% d\n", fun (5, & x)); static int a=1; /* Line 1*/
return 0; prtFun ();
} a+=1
What will be the output of above program? prtFun();
a)10 b) 8 c) 18 d) 12 printf(“\n %d%d”,a,b);
}
16. What does the following fragment of C- void prtFun(void)
program print? {
char c []="AAROHAN2012"; static int a=2; /* Line 2*/
char *p =c; int b=1; a+=++b;
printf ("%s", p+p[5]- p[1]); printf(“\n %d%d”,a,b);
}
a) AAROHAN2012 b) ROHAN2012
c) 2012 d) 12 19. What output will be generated by the above
given code segment if: Line 1 is replaced by
17. What does the following program print? auto int a =1;
void f( int *p, int * g) {
p= q; (a) (b) (c) (d)
*p= 2; 31 42 42 42
} 41 61 62 42
int i =0, j =1; 42 61 20 20
int main ( ){
f(&i, & j); 20. What output will be generated by the above
printf ("%d%d \ n", i, j ); given code segment if: Line 2 is replaced by
return 0; register int a=2;
}
a)2 2 b) 2 1 c) 0 1 d) 0 2 (a) (b) (c) (d)
31 42 42 42
18. What is the value printed by the following C 41 61 62 42
program? 42 61 20 20
int f(int * a, int n){
if (n<= 0) return 0; 21. What will be output of following c code?
else if(*a% 2== 0) int main(){

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
int i=2,j=2;
while(i+1?--i:j++)
printf ("%d",i); 25. int y[4]={6,7,8,9};
return 0; int *ptr =y+2;
} printf(%d\n,ptr[1]);

a)1 b) 2 c) 3 What is printed when the sample code above is


d) 4 e) Compilation Error executed?
a) 6 b) 7 c) 8 d) 9 e)
22. What will be output of the following Compilation error
program?
int main(){ 26. int main()
int i=1; {
i=2+2*i++; struct s1{ char *z; int i; struct s1 *p; };
printf("%d",i); static struct s1 a[]={{“Nagpur”,1,a+1},
return 0; {“Chennai” , 2,a+2}, {“Bangalore”,3,a}};
}
struct s1 *ptr =a;
a)4 b) 5 c) 6 printf(“%s”,++(ptr->z));
d) 7 e) Compilation Error printf(“%s”,a[(++ptr->i)].z);
printf(“%s”, a[--(ptr->p->i)].z);
23. What will be output when you will execute return 0;
following c code? }
int main (){
int a=100; a) Nagpur, Chennai, Bangalore
if(a>10) b) agpur, hennai, angalore
printf ("PCE"); c) agpur, Chennai, angalore
else if(a>20) d) agpur, Bangalore, Chennai
printf("PIET");
else if(a>30) 27. main() {
printf("PGI"); int a[2][3][2]= { {
return 0; {2,4},{7,8},{3,4}
} },
a) PCE b) PIET c) PCE PIET PGI {
d) Compilation error: more than one condition {2,2},{2,3},{3,4}
are true }
};
24. What will be output of following program?
int main(){ printf(“\n%u”,a+1);
char far *p =(char far *)0x55550005; printf(“\n%u”,*a+1);
char far *q =(char far *)0x53332225; printf(“\n%u”,**a+1);
*p = 80; (*p)++; printf(“\n%d”,***a+1);
printf("%d",*q); } If base address is 1000 then what will be
return 0; the output of above program:
} a)1000 1002 1002 1002 b) 1012 1004 1002
a) 80 b) 81 3
c) 82 c) 1002 3 4 5 d) 1024 1012 1004 8
d) Compilation Error e) None of the above

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
28. Can you write another expression which a)ONE b)NE
does the same job as ++*ptr? c)N d)E e) compile time error
(a) (ptr*)++
(b) *ptr++ 32. The output of the following program will be
(c) ptr*++ main(){
(d) (*ptr)++ int a=1,b=2,c=3;
printf(“%d”,a+=(a+=3,5,a));
29. What would be the equivalent pointer }
expression for referring the same element as a)8 b)12 c)9 d) 6
a[i][j][k][l]?
Consider the following recursive C function that
(a) *(*(*(*(a+i)+j)+k)+l) (b) takes two arguments
*(*(*(*a[i])[j])[k])[l]) unsigned int foo (unsigned int n, unsigned int r )
(c) both (d) None {
if( n> 0 ) return (n%r)+ foo (n / r, r );
30 What would be the output of the following else return 0;
program assuming that the array begins at }
location 1002? 33 What is the return value of the function foo in
above code when it is called as foo (513, 2)?
main( ) a) 9 b) 8 c) 5 d) 2
{
int a[3][4]={1,2,3,4, 34. What is the return value of the function foo
5,6,7,8, in above code when it is called as foo (345, 10)?
9,10,11,12 a) 345 b) 12 c) 5 d) 3 e) 10
};
printf( "\n%u %u 35. char ** array [12][12][12];
%u",a[0]+1,*(a[0]+1),*(*(a+0)+1)); Consider array, defined above. Which one of the
} following definitions and initializations of p is
valid?
(a) 1004 2 2 a) char ** (* p) [12][12] = array;
(b) 1004 4 4 b) char ***** p = array;
(c) 1002 2 2
(d) 1002 4 4 c) char * (* p) [12][12][12] = array;
d) const char ** p [12][12][12] = array;
31. void main(){
char *str="ONE"; e) char (** p) [12][12] = array;
str++;
switch(str){
case "ONE":printf("ONE");
break;
case "NE": printf("NE");
break;
case "N": printf("N");
break;
case "E": printf("E");
}
} what will be the output?

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Answer Sheet

1 c 16 A 31 e

2 c 17 D 32 a

3 d 18 C 33 d

4 d 19 C 34 b

5 a 20 D 35 a

6 c 21 A

7 c 22 B

8 b 23 A

9 a 24 B

10 a 25 D

11 c 26 D

12 d 27 B

13 d 28 D

14 b 29 A

15 b 30 A

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

PPS: Test

PART-A
Q.1 What would be the output of the following programs:

main( ) main( )
{ {
printf ( "\nOnly stupids use C?" ) ; int i = 45, c ;
display( ) ; c = check ( i ) ;
} printf ( "\n%d", c ) ;
display( ) }
{ check ( int ch )
printf ( "\nFools too use C!" ) ; {
main( ) ; if ( ch >= 45 )
} return ( 100 ) ;
else
OUTPUT: return ( 10 * 10 ) ;
}
OUTPUT:
main( ) main( )
{ {
float area ; int i = 5, j = 2 ;
int radius = 1 ; junk ( i, j ) ;
area = circle ( radius ) ; printf ( "\n%d %d", i, j ) ;
printf ( "\n%f", area ) ; }
} junk ( int i, int j )
circle ( int r ) {
{ i=i*i;
float a ; j=j*j;
a = 3.14 * r * r ; }
return ( a ) ;
} OUTPUT:
OUTPUT:
main( ) main( )
{ {
int i = 5, j = 2 ; int i = 4, j = 2 ;
junk ( &i, &j ) ; junk ( &i, j ) ;
printf ( "\n%d %d", i, j ) ; printf ( "\n%d %d", i, j ) ;
} }
junk ( int *i, int *j ) junk ( int *i, int j )
{ {
*i = *i * *i ; *i = *i * *i ;
*j = *j * *j ; j=j*j;
} }
OUTPUT: OUTPUT:

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
main( ) int i =0, j =1;
{ int main ( )
float a = 13.5 ; {
float *b, *c ; f(&i, & j);
b = &a ; /* suppose address of a is 1006 */ printf ("%d%d \ n", i, j );
c=b; return 0;
printf ( "\n%u %u %u", &a, b, c ) ; }
printf ( "\n%f %f %f %f %f", a, *(&a), *&a, *b, void f( int *p, int * g) {
*c ) ; p= q;
} *p= 2;
OUTPUT: }
int main () void foo (int n, int sum )
{ {
int a = 2048, sum = 0; int k = 0, j = 0;
foo (a, sum); if (n==0)
printf (“%d\n”, sum); return;
} k = n % 10;
j = n / 10;
sum = sum + k;
foo (j, sum);
OUTPUT: printf (“%d,”, k);
}

2. What would be the output of the following programs:


(a ) main( ) { (b ) main( ) { (c) main( ) {
Int j ; int i = 1 ; Int x = 1 ;
while ( j <= 10 ) for ( ; i <= 10 ; ) ; for (; x == 1; )
{ { {
printf ( "\n%d", j ) ; printf ( "\n%d", i ) ; x=x-1;
j=j+1; i++ ; printf ( "\n%d", x ) ;
} } }
} } }
Output: Output: Output:
(d) main( ) (e) main( ) { (f) main( ) {
{ while ( '1' < '2' ) int i = 10 ;
while ( 'a' < 'b' ) printf ( "\nIn while while ( i = 20 )
printf ( "\nmalyalam is a loop" ) ; printf ( "\nA computer
palindrome" ); } buff!" ) ;
} Output: }
Output: Output:

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
g) main( ) { h) main( ) main( )
int x = 4, y = 0, z ; { {
while ( x >= 0 ) Int x, y ; Int x, y ;
{ for (x=1; x<=5 ;x++) for (x=1; x<=5 ;x++)
if ( x == y ) { {
break ; for (y=1; y<=5 ; y++) for (y=1; y<=5 ; y++)
else break; continue;
printf ( “\n%d %d”, x, y ) ; printf ( "\n%d%d", x,y printf ( "\n%d%d", x,y ) ;
x-- ; ); }
y++ ; } }
} }
}
3. Point out the errors, if any, in the following programs:
(a ) main( ) (b) main( ) (c main( )
{ { {
int i = 10 ; int i = 10 ; int i = 10 ;
for ( i = 20 ) for ( i = 20 ; ) for ( ; i <= 20 ; )
printf ( "\nA computer buff!" ) ; i++; printf ( "\nA computer
} } buff!" ) ;
}

4. What would be the output of the following programs:


(a ) main( ) { (b ) main( ) { (c) main( ) {
int a = 300, b, c ; int a = 500, b, c ; int x = 3 ;
if ( a >= 400 ) if ( a >= 400 ) float y = 3.0 ;
b = 300 ; b = 300 ; if ( x == y )
c = 200 ; c = 200 ; printf ( "\n x and y are equal" )
printf ( "\n %d %d", b, c ) ; printf ( "\n%d %d", b, c ) ;
} ; else
Output: } printf ( "\n x and y are not
Output: equal" ) ;
} Output:
(d) main( ) (e) main( ) (f) main( ) {
{ { int i = 4, j = -1, k = 0, w, x, y, z ;
Int i = 4, z = 12 ; int p = 8, q = 20 ; w = i || j || k ;
if ( i = 5 || z > 50 ) if ( p == 5 && q > 5 ) x = i && j && k ;
printf ( "\nDean of students affairs" ) ; printf ( "\nWhy not C" ) ; y = i || j && k ;
else else z = i && j || k ;
printf ( "\nDosa" ) ; printf ( "\nDefinitely C !" printf ( "\nw = %d x = %d y = %d
} ); z = %d", w, x, y, z ) ;
} }
Output: Output:
Output:

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
PART-B

Q.1 In an array x[10] , the x represents the


(a) Base address (b) Base value (c) void pointer (d) first element

Q.2 int x[3]; if x[0] = 12 and x[2]=26 then x[3] is ………


(a) 0 (b) 15 (c) Garbage value (d) 20

Q.3 Array element are stored in memory as:


(a) Scattered memory location (b) Sequential memory locations (c) Both (a) and (b) (d) None

Q.4 int J[ 4 ] the sizeof(J) and sizeof( int ) will display the value.
(a) 8, 2 (b) 2, 8 (c) 4, 2 (d) 2, 4

Q.5 Which is the correct way to declare a pointer


(a) int *ptr (b) *int ptr (c) int ptr* (d) int_ptr x

Q.6 The &operator displays


(a) Address of variable (b) Value of the variable (c) Both (a) and (b) (d) Address of
pointer

Q.7 int x[3]={1, 2, 3} ; the address of x[2] is 65498 , the base address of the array is
(a) 65494 (b) 65495 (c) 65496 (d) 65492

Q.8 Which is the correct statement to declare an array?


(a) int x[ ]; (b) int x[5]; (c) int x{5}; (d) All
Q.9 What will happen if you assign values in few locations of an array
(a) Rest of the element will be set to zero (b) Compiler error message
(c) Possible system will crash (d) None
Q.10 In the following double x[3][3] = { 1.2, 9.0, 3.2, 9.2, 0.5, 1.5, 7.3, 7.9, 4.8 } what is in x[ 2] [1 ] ?
(a) 7.3 (b) 7.9 (c) 9.2 (d) There is no such array element
Q.11 num[i] is equal to
(a) *( num + i ) (b) *( i + num ) (c) i[num] (d) a, b, and c
Q. 12 what will be the output of the following program :
void main()
{
int num[6]= {1,2,3,4,5,6}, i ;
for ( i = 0 ; i <= 10 ; i++ )
printf("%d", num[i]);
}
Q 13. What would be the output of the following programs:

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

void main( ) void main( ) main( )


{ { {
int a[5] = { 5, 1, 15, 20, int num[ ] = { 24, 34, 12, 44, 56, 17 } ; int a[4][2]={1,2,3,4,5,6,7,8} ;
25 } ; int i ; printf ("%d", &a) ;
int i, j, k = 1, m ; for ( i = 0 ; i <= 5 ; i++ ) printf ("%d", a) ;
i = ++a[1] ; { printf ("%d", a[0]) ;
j = a[1]++ ; printf ( "\naddress = %u ", &num[i] ) ; printf ("%d", &a[0]) ;
m = a[i++] ; printf ( "element = %d %d ", num[i], printf ("%d", a[0]+1) ;
printf ( "\n%d %d %d", *( num + i ) ) ; printf ("%d", *a) ;
i, j, m ) ; printf ( "%d %d", *( i + num ), i[num] printf ("%d", *(a+0)) ;
} ); printf ("%d", a[1]) ;
Output: } printf ("%d", a[4][2) ;
} /* base address is 1000 */ printf ("%d", **a) ;
Output: printf ("%d", &a[0][0]) ;
} /* base address is1000 */

PART-C

Q.1 In given arrays char x[10] , and char x1[10]; what is difference between
(i) x = x1;
(ii) x == x1, and
(iii) strcpy(x,x1);

Q.2 What string does ptr point to in the sample code below?
char *ptr;
char myString [ ] = "abcdefg";
ptr = myString;
ptr += 5;

Q.3 What will be the output of the following program:


void main() void Func( int n[10])
{ int num[ ]= {
{1,2,3,4,5,6}, i; n[4]=n[4]+1;
Func(num); }
for( i=0;i<6;i++)
printf("%d",
num[i]);
}

Q.4 Which function is most appropriate for reading and writing in a multi-word string?

Q.5 What will be the output of the following program:


void main()
{ char ch[ ]="SKIT2018";
printf("%s", strrev(ch));
Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
printf("%s", ch);
}

Q.6 What does the following fragment of C-program print?


char c [ ]="PRAVAH2018";
char *p =c;
printf ("%s", p+p[5]- p[1]);

Q.7 What is printed when the sample code above is executed?


int y[4]={6,7,8,9};
int *ptr =y+2;
printf("%d\n", ptr[1]);

Q. 8 what will be the output of the following program :


void main()
{
char ch[6]= {'a', 'b' ,'c', d', 'e', 'f'','\0'}, i ;
for ( i = 0 ; i <= 10 ; i++ )
printf("%c", ch[i]);
}
Q 9. What would be the output of the following programs:
void main( ) void main( ) char* myFunc (char *ptr )
{ { {
char ch[10]="India"; char ch[10]="India"; ptr += 3; return
char *ch1; int i; char *ch1[10]= "India"; int i; (ptr);
ch1=ch; if(ch=ch1) }
for ( i = 0 ; ch1[i] != '\0' ; printf(" Strings are equal"); int main()
i++ ) else {
printf("%c", printf(" Strings are not equal"); char *x, *y;
ch1[i]); } x = "HELLO";
Output: y = myFunc (x);
} printf ("y = %s \n", y);
return 0;
Output: }
Output:

PART-D

1. WAP in C to reverse elements of an 1-D array without using any temporary variable or temporary
array.
2. Write definition of given function to find the location of a char in given string
char * strchar(char [], char);
3. A company insures its drivers in the following cases:

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
− If the driver is unmarried.
− If the driver is married, female & below 30 years of age.
− If the driver is married, male & below 25 years of age.

4. Write a program to produce the following output:

5. Write a function power ( a, b ), to calculate the value of a raised to b (with and without recursion)
6. Write a Function to generate table of given number using recursion
7. Write a program to swap two numbers using call by reference function calling method.
8. Write a program to generate Fibonacci series using recursion.
9. Write a program to copy content of a file into another file.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Assignments (As Per RTU QP Format)

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Assignment No. -1
PART: A

Q.1 Draw Von-Neumann Architecture. Explain different components of it.


Q.2 Explain program structure to be followed in C Programming language.
Q.3 What is data type? Explain different data types in C with the help of example(size, range, storage).
Q.4 Explain syntax and uses of printf() and scanf() with the help of an example.
Q.5 Differentiate keywords and identifiers in C programming language with the help of an example.
Q.6 Differentiate variable and constant with the help of an example.
Q.7 Why variables are required in C programming language? explain with the help of an example.
Q.8 What do you mean by High-level and low level programming languages?
Q.9 Draw and explain C execution process.
Q.10 Explain the role of compiler. How it is different from execution?

PART:B

Q.11 What is flow chart? Explain different symbols used in flowchart.


Q.12 Draw flowchart to find that given number is odd or even.
Q.13 Draw flowchart to swap two given number
Q.14 Give one example each on multiple ifs , if-else, nested if-else, if- else if .
Q.15 Explain different logical and relational operators with example for each operator.
Q.16 How character variable is initialized? How to use arithmetic and relational operators on it.
Q.17 Demonstrate uses of arithmetic operators on Integer, character and float data types
Q.18 What are conditional operators? How it is different from switch-case statement?

PART: C (Programming )

Q.19 A triple of numbers (a,b,c) is called a triangle triple if we can form a triangle of lengths a, b and c. In this
question, you will be given three numbers. You have to output 1 if the three numbers can form a triangle.
Otherwise, you have to output 0.
Q.20 You will be given 3 integers as input. The inputs may or may not be different from each other. You have to
output 1 if all three inputs are different from each other, and 0 if any input is repeated more than once.
Q.21 You are given two integers, say M and N. You must check whether M is an exact multiple of N, without
using loops. You have to output 0 if M is not a multiple of N. You have to output M/N if M is a multiple of N.
Q.22 Three numbers form a Pythagorean triple if the sum of squares of two numbers is equal to the square of the
third. For example, 3, 5 and 4 form a Pythagorean triple, since 3*3 + 4*4 = 25 = 5*5.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Programming for Problem Solving

Assignment No. -2
Note: Q.1 to Q.7 is for practice only. Do Q.8 to Q. 15 in assignment notebook

1. An expression contains relational operators, assignment operators, and arithmetic operators.


In the absence of parentheses, they will be evaluated in which of the following order:

1. assignment, relational, arithmetic 2. arithmetic, relational, assignment


3. relational, arithmetic, assignment 4. assignment, arithmetic, relational

2. The break statement is used to exit from:


1. an if statement 2. a for loop 3. a program 4. the main( ) function

3. A do-while loop is useful when we want that the statements within the loop must be executed:
1. Only once 2. At least once 3. More than once 4. None of the above

4. In what sequence the initialization, testing and execution of body is done in a do-while loop

1. Initialization, execution of body, testing 2. Execution of body, initialization, testing


3. Initialization, testing, execution of body 4. None of the above

5. Which of the following statement is used to take the control to the beginning of the loop?
1. exit 2. break 3. continue 4. None of the above

6. What would be the output of the following programs:


(a ) main( ) { (b ) main( ) { (c) main( ) {
Int j ; int i = 1 ; Int x = 1 ;
while ( j <= 10 ) for ( ; i <= 10 ; ) ; for (; x == 1; )
{ { {
printf ( "\n%d", j ) ; printf ( "\n%d", i ) ; x=x-1;
j=j+1; i++ ; printf ( "\n%d", x ) ;
} } }
} } }
Output: Output: Output:
(d) main( ) (e) main( ) { (f) main( ) {
{ while ( '1' < '2' ) int i = 10 ;
while ( 'a' < 'b' ) printf ( "\nIn while loop" ) ; while ( i = 20 )
printf ( "\nmalyalam is a palindrome" ); } printf ( "\nA computer buff!" )
} Output: ;
Output: }
Output:

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
g) main( ) { h) main( ) main( )
int x = 4, y = 0, z ; { {
while ( x >= 0 ) Int x, y ; Int x, y ;
{ for (x=1; x<=5 ;x++) for (x=1; x<=5 ;x++)
if ( x == y ) { {
break ; for (y=1; y<=5 ; y++) for (y=1; y<=5 ; y++)
else break; continue;
printf ( “\n%d %d”, x, y ) ; printf ( "\n%d%d", x,y ) ; printf ( "\n%d%d", x,y ) ;
x-- ; } }
y++ ; } }
}
}
7. Point out the errors, if any, in the following programs:
(a ) main( ) (b) main( ) (c main( )
{ { {
int i = 10 ; int i = 10 ; int i = 10 ;
for ( i = 20 ) for ( i = 20 ; ) for ( ; i <= 20 ; )
printf ( "\nA computer buff!" ) ; i++; printf ( "\nA computer
} } buff!" ) ;
}

8. Write a program to print out all Armstrong 11. Write a program to print the below
numbers between 1 and 500. pattern:
1 1
9. Write a program to print all prime numbers upto n. 2 1
2 2
10.Write a program to produce the following output: 3 1
3 2
3 3
4 1
4 2
4 3
4 4

OR
12. Differentiate break and continue with
suitable example

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

13. 33333 14. Draw flowchart to find a given number is prime or not.
32223 15. What is algorithm? explain different characteristics of an
32123 algorithm.
32223 (i) write an algorithm to find that a given is odd or even.
(ii) write an algorithm to find reverse of a given number
33333 using loop

1
3 8 5
7 9 40 11 13

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Assignment No. - 3

Semester/Session: I / 2020-21 Branch: AI, CSE, ME (Group-1)


Subject: Programming for Problem Solving Subject Code : 1FY3-06
Maximum Marks: 10 Google classroom Code:
Important Instructions:
1. Attempt all questions. All question carry equal marks
2. Do fill your details on the top of the first page of the answer copy.
3. Your answer sheet must be submitted under the file name as given below:-
A-1-YourName .pdf; Ex:- A-1-VinodKumarVerma.pdf
4. Upload the answer sheets on Google Classroom in pdf format.
_____________________________________________________________________________________________

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Note: Use above database and do the following:

Q: 1 Write a program in C to find the percentage of the student named "Ravi".

Q: 2 Write a program in C to find the maximum percentage scored from section 'J'.

Q: 3 Write a program in C to find number of students whose starting letter of the name is 'R'.

Q: 4 Write a program in C to find and display the percentage of each student.

Q: 5 Write a program in C to find the name of the student who scored minimum percentage.

Q: 6 Write a program in C Find number of students belongs to Section I, Section J and Section
K.

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Practice Exercises on Number System

Q.1 Convert the following octal number to their binary equivalents


(a) (372) (b) (0.301) (c) (746.52)

Q.2 Convert the following binary number to their octal equivalents


(a) (10010111) (b) (0.0110101) (c) (1110100.0100111)

Q.3 Convert the following hexadecimal number to their binary equivalents


(a) 47A (b) (0.B0D) (c) (17E.F6)

Q.4 Convert the following binary number to their hexadecimal equivalents


(a) (1011011011) (b) (0.010011011) (c) (1011001110.011111)

Q.5 Convert the following number to their decimal equivalents


(a) (11101.1011)2 (b) (651.7)8 (c) (EF9.B)16
Q.6 Convert the following
(a) (57.54379)10 to binary
(b) (543.815)10 to octal
(c) (683.275)10 to hexadecimal

Q.7 Determine vale of base x if (193)x = (623)8


Q.8 Convert hexadecimal (2AC5)16 to binary, octal and decimal number

Q.9 Convert
(a) (225.225)10 to binary
(b) (623.77)8 to decimal
(c) (2AC5.D)16 to decimal
(d) (2AC5.D)16 to binary

Q.10 Find the 1’s complement of the following binary numbers.


(a) (1101100) (b) (0.1011) (c) (1101100.1011)

Q.11 Find the 2’s complement of the following binary numbers.


(a) (1101100) (b) (0.1011) (c) (1101100.1011)

Q.12 Find the 9’s complement of the following decimal numbers.


(a) (23567) (b) (37.562) (c) (243)

Q.13 Find the 10’s complement of the following decimal numbers.


(a) (23567) (b) (0.8642) (c) (1056.074)
Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in
Q.14 Find the 7’s complement of the following octal numbers.
(a) (407.270) (b) (0156.0037)

Q.15 Find the 8’s complement of the following octal numbers.


(a) (346) (b) (217.275)

Q.16 Find the 15’s complement of the following hexadecimal numbers.


(a) (A9B) (b) (83D.9F)

Q.17 Find the 16’s complement of the following hexadecimal numbers.


(a) (A8C) (b) (0070C.B6E)

Q.18 Find the addition of following binary numbers


(a) (1011.01) + (11.011)
(b) (110111) + (011100)
(c) (1110) + (1111)
(d) (10111010) + (10101)

Q.19 Find the subtraction of following binary numbers


(a) (101101) - (100111)
(b) (1011011) - (110101)
(c) (1110110) - (1010111)
(d)(10101.101) - (1011.11)

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Details of Efforts Made to Fill Gap Between COs and POs (Expert Lecture/
Workshop/ Seminar /Extra Coverage in Lab etc.)
Theory: Based on the recent technological trends, advanced and deeper understanding required for the
subject to model complex engineering activities with an understanding of the limitations. Efforts Made
to Fill Gap Between COs and POs (PO6, PO7, PO8,PO10 and PSO3) through is done by including two
beyond curriculum topics.

1. Students enrolled in SWAYAM/ NPTEL course on C Programming to get enhanced knowledge in


this subject and make better understanding of the concepts by doing the assignments.
2. Some important Gate level Questions have been discussed in the form of class test and quiz.
3. Programming competition.
4. Discussion and introduction of C with advanced programming language C++, Java and Python.

Mapping with POs/PSOs

Beyond PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO PSO


Syllabus 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3
2 3 3 2 1 1 2 2 2 1 1 2 1
1
2 3 2 2 2 1 1 2 3 2 2 2 2 2 1
2

2 3 2 2 2 1 1 2 3 2 2 2 2 2 1
3

2 3 3 2 1 1 2 2 2 1 1 2 1
4

Page |
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400 Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Laboratory: Based on the recent technological trends, advanced and deeper understanding required
for the subject to model complex engineering activities with an understanding of the limitations. Efforts
Made to Fill Gap Between COs and POs (PO6, PO7, PO8,PO10 and PSO3) through is done by
including two beyond curriculum topics.
1. Students enrolled in SWAYAM/ NPTEL course on C Programming to get enhanced knowledge in
this subject and make better understanding of the concepts by doing the assignments.
2. Data Structure topics like Structure, Stack and Queue have implement in C Programming.
3. Mini Project will be assigned to Students so that they are able to implement the concepts Arrays,
Functions, Structure, Pointers, File Handling etc. in real world application. This will help them to
develop additional skills such as problem solving, critical thinking, team work and time management.
4. Programming Competition.

Mapping with POs/PSOs

Beyond PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO PSO


Syllabus 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3
2 3 3 2 1 1 2 2 2 1 1 2 1
1
1 2 1 1 1 1 2
2

2 3 3 3 2 2 2 2 3 2 1 2 3 2 1
3

2 3 2 2 2 1 1 2 3 2 2 2 2 2 1
4

Page |
UNIT-I
UNIT-III
UNIT-IV
E-> TR
R-> +TR/ -TR/
T->num
UNIT-V
UNIT-VI
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Question Bank:
Unit-I

Q1. What is a compiler?


A. A compiler does a conversion line by line as the program is run
B. A compiler converts the whole of a higher level program code into machine code in one step
C. A compiler is a general purpose language providing very efficient execution
D. All of the Above
Ans.: B

Q2. Users write the programs in which language?


A. Low-level Language
B. High-Level Language
C. Decimal-Format
D. Middle-Level Language
Ans: B

Q3. Which computer program accepts the high-level language and converts it into assembly
language?
A. Interpreter
B. Linker
C. Assembler
D. Compiler
Ans: D

Q4. Does the compiler program translate the whole source code in one step?
A. No
B. Depends on the Compiler
C. Don't Know
D. Yes
Ans:D

Q5.Which tool is used for grouping of characters in tokens in the compiler?


A. Parser
B. Code optimizer
C. Code generator
D. Scanner
Ans: D

Q6.What is the linker?


A. It is always used before the program execution.
B. It is required to create the load module.
C. It is the same as the loader
D. None of the above
Ans: B

Page | 1
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Unit-II

Q1. What are the stages in the compilation process?


A. Feasibility study, system design, and testing
B. Implementation and documentation
C. Analysis Phase, Synthesis Phase
D. None of These
Ans.: C

Q2. What is the definition of an interpreter?


A. An interpreter does the conversion line by line as the program is run
B. An interpreter is a representation of the system being designed
C. An interpreter is a general purpose language providing very efficient execution
D. All of the Above
Ans.: A

Q3. Symbol table can be used for


A. Checking type compatibility
B. Storage allocation
C. Suppressing duplication of error massages
D. All of the Above
Ans.: D

Q4. Assembly language


A. is usually the primary user interface
B. requires fixed format commands
C. is a mnemonic form of machine language
D. is a quite different from the SCL interpreter
Ans.: C

Q5. Every symbolic references to a memory operand has to be assembled as


A. (offset, index base)
B. (segment base, offset)
C. (index base, offset)
D. offset
Ans.: B

Q6. Which translator program converts assembly language program to object program
A. Assembler
B. Compiler
C. Microprocessor
D. Linker
Ans.: A

Q7. A compiler for a high level language that runs on one machine and produces code for a
different machine is called

Page | 2
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

A. Optimizing compiler
B. One pass compiler
C. Cross compiler
D. Multipass Compiler
Ans.: C

Q8. The action of passing the source program into the proper syntactic classes is known as
A. syntax analysis
B. lexical analysis
C. interpretation analysis
D. general syntax analysis
Ans.: B

Q9. Grouping of characters into tokens is done by the


A. scanner
B. parser
C. code generator
D. code optimizer
Ans.: A

Q10. Lexical analysis phase uses


A. regular grammar
B. context free grammar
C. context sensitive grammar
D. none of the above
Ans.: A

Page | 3
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Unit-III

Q1. Which one of the following is not a syntax error


A. Semantic
B. Lexical
C. Arithmetic
D. Logical
Ans.: A

Q2. CFG can be recognized by a


A. Push-down automata
B. 2-way linear bounded automata
C. Both (a) and (b)
D. None of these
Ans. C

Q3. The ambiguous grammar can have


A. Only one parse tree
B. More than one parse tree
C. Parse trees with l-values
D. None of the above
Ans. B

Q4. Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar
A. Removing left recursion alone
B. Factoring the grammar alone
C. Removing left recursion and factoring the grammar
D. None of the above
Ans. C

Q5. The ‘k’ in LR(k) cannot be


A. 0
B. 1
C. 2
D. None of these
Ans. D

Q6. Non backtracking form of the top-down parser are called


A. Recursive-descent parsers
B. Predictive parsers
C. Shift reduce parsers
D. None of these
Ans. B

Q7. Parsing table in the LR parsing contains


A. action, goto

Page | 4
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

B. state, action
C. input, action
D. state, goto
Ans. A

Q8. The condensed form of the parse tree is called


A. L-attributed
B. Inherited attributed
C. DAG
D. Syntax tree
Ans. D

Q9. Shift-reduce parsers are


A. top-down parsers
B. bottom-up parsers
C. both (a) and (b)
D. none of these
Ans. B

Q10. In some programming languages, an identifier is permitted to be a letter followed by any


number of letters or digits. If L and D denote the sets of letter and digits respectively, which
expression defines an identifier?
A. (LUD)+
B. L(LUD)*
C. (LD)*
D. L(LD)*
Note: Here U stands for Union
Ans. B

Q11. Backtracking is possible in


A. LR parsing
B. Predictive parsing
C. Recursive descent parsing
D. None of the above
Ans. C

Q12. Consider the following grammar


expr op expr
expr->id
op-> + | *
Which of the following is true?
A. op and expr are start symbols
B. op and id are terminals
C. expr is start symbol and op is terminal
D. none of these
Ans. C

Page | 5
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Q13. To compute FOLLOW(A) for any grammar symbol A


A. We must compute FIRST of some grammar symbols
B. No need of computing FIRST of some symbol
C. May compute FIRST of some symbol
D. None of these
Ans. A

Q14. Which language is generated by the given grammar S-> 0S1 | 01


A. 0011
B. 00*11
C. 001*1
D. 00*1*1
Ans. D

Q15. The space consuming but easy parsing is

A. LALR
B. SLR
C. LR
D. Predictive parser
Ans. A

Q16. A top down parser generates


A. left-most derivation
B. right-most derivation
C. right-most derivation in reverse
D. left-most derivation in reverse
Ans. A

Q17. Choose the false statement


A. LL(k) grammar has to be a CFG
B. LL(k) grammar has to be unambiguous
C. There are LL(k) grammars that are not Context Free
D. LL(k) grammars cannot have left recursive non-terminals
Ans. C

Q18. If a grammar is unambiguous then it is surely be


A. regular
B. LL(1)
C. Both (a) and (b)
D. Cannot say
Ans. D

Q19. Predictive parsing is a special case of


A. top down parsing

Page | 6
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

B. bottom up parsing
C. recursive descent parsing
D. none of the above
Ans. C

Page | 7
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Unit-IV

Q1. Type checking is normally done during


A. lexical analysis
B. syntax analysis
C. syntax directed translation
D. code optimization
Ans.: C

Q2. An intermediate code form is


A. Postfix notation
B. Syntax trees
C. Three address code
D. All of these
Ans.: D

Q3. Semantic errors can be detected


A. at compile time only
B. at run time only
C. both at compile and run time
D. none of these
Ans.: C

Q4. Undeclared name is …………… error


A. syntax
B. lexical
C. semantic
D. not an error
Ans. C

Q5. Intermediate code generator is used between


A. symbol table and code generator
B. symbol table and code optimizer
C. code optimizer and code generator
D. semantic analyzer and code optimizer
Ans.: D

Q6. ‘Divide by 0’ is a
A. lexical error
B. syntactic error
C. semantic error
D. internal error
Ans. C

Q7. In which of the following has attribute values at each node


A. Associated parse trees

Page | 8
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

B. Postfix parse tree


C. Annotated parse tree
D. Prefix parse tree
Ans.: C

Q8. The post fix form of A-B/(C*D$E) is


A. ABCDE$*/-
B. AB/C*DE$
C. ABCDE$-/*
D. ABCDE/-*$
Ans. A

Q9. Synthesized attribute can easily be simulated by an


A. LL grammar
B. Ambiguous grammar
C. LR grammar
D. None of the above
Ans. C

Q10. The prefix form of (A+B)*(C-D) is


A. +-AB*C-D
B. *+-ABCD
C. *+AB-CD
D. *AB+CD
Ans. C

Q11. In a syntax directed translation scheme, if the value of an attribute of a node is a function of
the values of the attributes of its children, then it is called a
A. Synthesized attribute
B. Inherited attribute
C. Canonical attribute
D. None of the above
Ans. A

Q12. Which of the following is not an intermediate code form?


A. Postfix notation
B. Syntax trees
C. Three address code
D. Quadruples
Ans. D

Q13. Three address codes can be implemented by


A. indirect triples
B. direct triples
C. both (a) and (b)

Page | 9
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

D. none of the above


Ans. A

Q14. In a bottom up evaluation of a syntax directed definition, inherited attributes can be


A. always be evaluated
B. be evaluated only if the definition is L-attributed
C. be evaluated only if the definition has synthesized attributes
D. none of the above
Ans. C

Q15. Three address code involves


A. at the most 3 address
B. exactly 3 address
C. no unary operators
D. none of the above
Ans. A

Q16. Inherited attribute is a natural choice in


A. keeping track of variable declaration
B. checking of the correct use of L-values and R-values
C. both (a) and (b)
D. none of the above
Ans. C

Page | 10
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Unit-V

Q1. The idea of cache memory is based __________


A. On the property of locality of reference
B. On the heuristic 90-10 rule
C. On the fact that references generally tend to cluster
D. All of the mentioned
Ans. A

Q2.Which of the following known as the text part of a program that does not change at runtime. Its
memory requirements are known at the compile time?
A. Code
B. Procedures
C. Variables
D. All of the above
Ans: A

Q3.A procedure has a start and an end delimiter and everything inside it is called the body of the
procedure.
A. TRUE
B. FALSE
C. A procedure has a start with delimiter but not end with delimiter.
D. A procedure has a not start with delimiter but end with delimiter.
Ans: A

Q4.In activation record, Which of the following Stores the address of activation record of the caller
procedure?
A. Access Link
B. Actual Parameters
C. Control Link
D. Temporaries
Ans: C

Q5. Whenever a procedure is executed, its activation record is stored on the stack, also known as?
A. Access Stack
B. Control stack
C. Formal Stack
D. Return Stack
Ans : B

Q6. _________ are known at the runtime only, unless they are global or constant.
A. Values
B. Object
C. Variables
D. All of the above
Ans : C

Page | 11
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Q7.The location of memory (address) where an expression is stored is known?


A. r-value
B. k-value
C. l-value
D. t-value
Ans : C

Q8.What is true about Formal Parameters?


A. These variables are declared in the definition of the called function.
B. These variables are specified in the function call as arguments.
C. Variables whose values or addresses are being passed to the called procedure are called
Formal Parameter.
D. All of the above
Ans: A

Q9.In which mechanism, the calling procedure passes the r-value of actual parameters and the
compiler puts that into the called procedure’s activation record?
A. Pass by Reference
B. Pass by Name
C. Pass by Copy-restore
D. Pass by Value
Ans: D

Q10.In which mechanism, the name of the procedure being called is replaced by its actual body?
A. Pass by Reference
B. Pass by Name
C. Pass by Copy-restore
D. Pass by Object
Ans: B

Q11.What will be error?


7 = x + y;
A. l-value error
B. r-value error
C. Infinite loop
D. Both A and B
Ans: A

Page | 12
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Unit-VI

Q1. A basic block can be analyzed by


A. A DAG
B. A graph which may involve the cycles
C. Flow Graph
D. None of These
Ans.: A

Q2. Which of the following is true for the flow of control among procedures during execution of
program?
A. Control flows randomly
B. Control flows line by line without jumping
C. Control flows sequentially
D. None of these
Ans. C

Q3. The identification of common sub-expression and replacement of run time computations by
compile-time computations is------
A. Local optimization
B. Constant folding
C. Loop optimization
D. Data flow analysis
Ans: B

Q4. Which of the following class of statement usually produces no executable code when
compiled?
A. Declaration
B. Assignment statements
C. Input and output statements
D. Structural statements
Ans: A

Q5. Code optimization is responsibility of--------


A. Application programmer
B. System programmer
C. Operating system
D. All of the above.
Ans: B

Q6. Dead-code elimination in machine code optimization refersto -----------


A. Removal of all labels.
B. Removal of values that never get used.
C. Removal of function which are not involved.
D. Removal of a module after its use.
Ans: B

Page | 13
Swami Keshvanand Institute of Technology, Management & Gramothan,
Ramnagaria, Jagatpura, Jaipur-302017, INDIA
Approved by AICTE, Ministry of HRD, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Tel. : +91-0141- 5160400Fax: +91-0141-2759555
E-mail: [email protected] Web: www.skit.ac.in

Q.7. Which of the following statement is false?


A. Flow graph is used to represent DAG.
B. Three address code is the input to the code generator.
C. The first statement of three address code is always leader of the first basic block.
Transformation of block is needed for code optimization.
Ans: A

Q.8. -------- is the final phase of compiler.


A. Semantic analysis
B. Code generation
C. Target code generation
D. Syntax analysis
Ans: B

Q.9.Some code optimizations are carried out on the intermediate code because------
A. They enhance the portability of the compiler to other target processors
B. Program analysis is more accurate on intermediate code than on machine code
C. The information from dataflow analysis cannot otherwise be used for optimization

D. The information from the front end cannot otherwise be used for optimization
Ans: A

Q.10 Peephole optimization is form of------


A. Loop optimization
B. Local optimization
C. Constant folding
D. Data flow analysis
Ans: B

Page | 14

You might also like