5CS4-02 Compiler Design Course File Neha Mathur
5CS4-02 Compiler Design Course File Neha Mathur
A
Course File
on
(Compiler Design: 5CS4-02)
(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
Note:
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:
“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.
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
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.
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
Prerequisite of Course
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
1. Aho, Alfred V., Ravi Sethi and Jeffrey D. Ullman, “Compilers, principles, techniques.”, Addison Wesley 7,
no.8 (1986):9, Pearson Education.
8. Charles Fischer and Richard LeBlane, “Crafting a Compiler with C”, Pearson Education.
1. Srikant, Y.N., and Priti Shankar, eds. The Compiler design handbook: optimizations and Machine
3. Grune, Dick, et al. Modern Compiler Design, Springer Science & Business Media, 2012.
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
Coverage
SUBJECT:………………………………. BRANCH:……………. SEMESTER:………………….
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
Program Outcome/Program
Indicator Statement
Specific Outcome
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.
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)
Analyze data for trends and correlations, stating possible errors and
4.3.2
limitations
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.
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
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
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
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.
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.
Bloom’s Taxonomy
Level Descriptor Level of Attainment Keywords
** 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
Section
Section
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
In addition with the syllabus, following topics will be discussed again/separately for average students
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
➢ Assignment/Quiz/Test
➢ Demonstrations
➢ Problem Solving
- Power Point
- Problem Solving - Assignment/Test
Presentation
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
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
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
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
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
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
COs
Q1 Q2 Q3 Q4 Q5
CO1 3 - - - -
CO2 - 3 - - -
CO3 - - 3 - -
CO4 - - - 3 -
CO5 - - - - 3
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
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%
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
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
CO1 2 - - 3 - - - -
CO2 - - - - - - - -
CO3 - 1 - - - - - -
CO4 - - 2 - 1 2 - 2
CO5 - - - - - - 2 -
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
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
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
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]);
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);
}
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!" ) ;
}
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.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.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
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-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.4 Which function is most appropriate for reading and writing in a multi-word string?
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.
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
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
PART:B
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
Assignment No. -2
Note: Q.1 to Q.7 is for practice only. Do Q.8 to Q. 15 in assignment notebook
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
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
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
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: 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: 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
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
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.
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.
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
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
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
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
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
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
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
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
A. LALR
B. SLR
C. LR
D. Predictive parser
Ans. A
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
Q6. ‘Divide by 0’ is a
A. lexical error
B. syntactic error
C. semantic error
D. internal error
Ans. C
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
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
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
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
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
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
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
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
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.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
Page | 14