M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

Similar documents
M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

A3-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH 'C' LANGUAGE

M1-R4: Programing and Problem Solving using C (JAN 2019)

M1-R4: Programing and Problem Solving using C (JULY 2018)

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

Computers Programming Course 6. Iulian Năstac


Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

Introduction to C Language (M3-R )


Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

DETAILED SYLLABUS INTRODUCTION TO C LANGUAGE

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators

A flow chart is a graphical or symbolic representation of a process.

Full file at C How to Program, 6/e Multiple Choice Test Bank

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

COMPUTER APPLICATION

Questions Bank. 14) State any four advantages of using flow-chart

Computers Programming Course 5. Iulian Năstac

Multiple Choice Questions ( 1 mark)

MCA Semester 1. MC0061 Computer Programming C Language 4 Credits Assignment: Set 1 (40 Marks)

(i) Describe in detail about the classification of computers with their features and limitations(10)

Review of the C Programming Language for Principles of Operating Systems

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

C Programming Multiple. Choice

C library = Header files + Reserved words + main method

I Internal Examination Sept Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs.

IECD Institute for Entrepreneurship and Career Development Bharathidasan University, Tiruchirappalli 23.

Arrays and Pointers. CSE 2031 Fall November 11, 2013

Operators and Expressions:

Fundamentals of Programming

CSCI 171 Chapter Outlines

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA

C-LANGUAGE CURRICULAM

Module 6: Array in C

Arrays and Pointers. Arrays. Arrays: Example. Arrays: Definition and Access. Arrays Stored in Memory. Initialization. EECS 2031 Fall 2014.

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:

Computers Programming Course 11. Iulian Năstac

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

Tutorial No. 2 - Solution (Overview of C)

Tribhuvan University Institute of Science and Technology 2065

COMPUTER SCIENCE HIGHER SECONDARY FIRST YEAR. VOLUME II - CHAPTER 10 PROBLEM SOLVING TECHNIQUES AND C PROGRAMMING 1,2,3 & 5 MARKS

Fundamental of Programming (C)

Arrays and Pointers (part 1)

OBJECTIVE QUESTIONS: Choose the correct alternative:

A complex expression to evaluate we need to reduce it to a series of simple expressions. E.g * 7 =>2+ 35 => 37. E.g.

Pointers (part 1) What are pointers? EECS We have seen pointers before. scanf( %f, &inches );! 25 September 2017

P.G.TRB - COMPUTER SCIENCE. c) data processing language d) none of the above

Review of the C Programming Language

Unit 3. Operators. School of Science and Technology INTRODUCTION

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

Operators in C. Staff Incharge: S.Sasirekha

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

UNIT IV 2 MARKS. ( Word to PDF Converter - Unregistered ) FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING

PERIYAR CENTENARY POLYTECHNIC COLLEGE Periyar Nagar- Vallam Thanjavur

AE52/AC52/AT52 C & Data Structures JUNE 2014

bphanikrishna.wordpress.com

Reg. No. : Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, JANUARY First Semester GE 6151 COMPUTER PROGRAMMING

OBJECT ORIENTED PROGRAMMING

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS 1 ST INTERNAL ASSESMENT TEST (SCEME AND SOLUTIONS)

Week 2 Introduction to Computer and Algorithm (Part 2)

UNIT 3 OPERATORS. [Marks- 12]

BLM2031 Structured Programming. Zeyneb KURT

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size];

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Basic Science and Humanities

Q1. Multiple Choice Questions

Q 1. Attempt any TEN of the following:

C: How to Program. Week /Mar/05

Basics of Programming

UNIT- 3 Introduction to C++

ONE DIMENSIONAL ARRAYS

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Arrays and Pointers (part 1)

Reg. No. : Question Paper Code : 27157

Important Questions for Viva CPU

C++ Programming: From Problem Analysis to Program Design, Third Edition

PROGRAMMING IN C AND C++:

Guide for The C Programming Language Chapter 1. Q1. Explain the structure of a C program Answer: Structure of the C program is shown below:

Other C materials before pointer Common library functions [Appendix of K&R] 2D array, string manipulations. <stdlib.

Laboratory 3 OPERATORS, EXPRESSIONS, INSTRUCTIONS I. THEORETICAL BACKGROUND

Lecture 2: C Programming Basic

Chapter 2 - Introduction to C Programming

Programming for Problem Solving 105A L T P Credit Major Minor Total Time

Decision Making -Branching. Class Incharge: S. Sasirekha

Subject: Fundamental of Computer Programming 2068

Computers Programming Course 7. Iulian Năstac

As stated earlier, the declaration

Code No: R Set No. 1

M4.1-R4: APPLICATION OF.NET TECHNOLOGY

PDS Lab Section 16 Autumn Tutorial 3. C Programming Constructs

Arrays. An array is a collection of several elements of the same type. An array variable is declared as array name[size]

Transcription:

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF ANSWER SHEET only, attached to the question paper, as per the instructions contained therein. PART ONE is NOT to be answered in the answer book. 3. Maximum time allotted for PART ONE is ONE HOUR. Answer book for PART TWO will be supplied at the table when the answer sheet for PART ONE is returned. However, candidates, who complete PART ONE earlier than one hour, can collect the answer book for PART TWO immediately after handing over the answer sheet for PART ONE. TOTAL TIME: 3 HOURS TOTAL MARKS: 100 (PART ONE 40; PART TWO 60) PART ONE (Answer all the questions) 1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) 1.1 The operator & is used for A) Bitwise AND B) Bitwise OR C) Logical AND D) Logical OR 1.2 Built-in data structures in C are A) Arrays B) Structures C) Files D) All of the above 1.3 The size of a character variable in C is A) 4 byte B) 8 bytes C) 16 bytes D) None of the above 1.4 What is the output of the following program segment? #include<stdio.h> main() { int i=10, m=10; clrscr(); printf( %d, i>m?i*i:m/m,20); getch(); } M4.1-R3 Page 1 of 5 January, 2009

A) 20 B) 1 C) 120 D) 100 20 1.5 Data type of the controlling statement of a SWITCH statement cannot of the type: A) int B) char C) short D) float 1.6 How long the following loop runs: for (x=0; x=3; x++) A) Three time B) Four times C) Forever D) Never 1.7 An expression contains assignment, relational and arithmetic operators. If parentheses are not specified, the order of evaluation of the operators would be: A) assignment, arithmetic, relational B) relational, arithmetic, assignment C) assignment, relational, arithmetic D) arithmetic, relational, assignment 1.8 The CONTINUE statement cannot be used with A) for B) switch C) do D) while 1.9 Output of the following program will be: main( ) { int a [ ] = {1, 2, 9, 8, 6, 3, 5, 7, 8, 9}; int *p = a+1; int *q = a+6; printf ( \n%d, q-p); } A) 9 B) 5 C) 2 D) None of the above 1.10 Size of the following union (assume size of int=2; size of float=4 and size of char = 1): union Jabb { int a; float b; char c; }; A) 2 B) 4 C) 1 D) 7 M4.1-R3 Page 2 of 5 January, 2009

2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the tear-off sheet attached to the question paper, following instructions therein. (1 x 10) 2.1 Scalar data types are not supported by C language. 2.2 C language allows arrays of any dimensions. 2.3 A structure cannot be read as a single entity. 2.4 The associativity of operator! is from left to right.. 2.5 J++ executes faster than J+1 because ++ is faster than +. 2.6 Two structures cannot be compared automatically. 2.7 The code "a[i] = i++;" is valid and will execute. 2.8 Arrays automatically allocate space when declared. 2.9 sizeof( a ) is not 1. 2.10 Float value can be added to a pointer. 3. Match words and phrases in column X with the closest related meaning/ word(s)/phrase(s) in column Y. Enter your selection in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) X 3.1 The operator && is an example of A. Arrays 3.2 Preprocessor commands are always preceded by 3.3 Header files in C contain C. /0 Y B. Storage class 3.4 Structures in C can be used with D. Shifting bits 3.5 Static defines a E. # 3.6 Null character is represented by F. string.h 3.7 File manipulation functions are available in 3.8 An example of unconditional control structure is G. Masking H. Switch statement 3.9 Header file required for strcpy I. Logical 3.10 The bitwise AND operator is used for J. #define K. Macro definitions L. stdio.h M. Goto N. strcpy O. Library functions M4.1-R3 Page 3 of 5 January, 2009

4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) A. integer array B. pointers C. program D. printf( ) and scanf( ) E. character array F. && G. function H. Main I. getw( ) J. reference, value K. static L. for M. extern N. ternary O. register P. putw( ) Q. main( ) 4.1 Formatted I/O can be produced with the routine(s). 4.2 The statement is used to loop as long as a specified condition is met. 4.3 To create a string variable, me must declare a(n) with enough elements to contain the entire string. 4.4 Call by is more efficient than call by file. 4.5 exit( ) function is used to terminate the. 4.6 The only operator that contains three operands is operator. 4.7 The declaration does not allocate storage space for variable. 4.8 The function reads an integer from a file. 4.9 All buffers are cleared when a closed. 4.10 Preprocessor directives are placed in the source program before the function. M4.1-R3 Page 4 of 5 January, 2009

PART TWO (Answer any FOUR questions) 5. a) What are the commonly used input functions in C? Write their syntax and explain the purpose of each. b) Develop a flowchart and then write a program to compute the roots of a quadratic equation A*X^2 + B*X + C = 0. Allow the possibility that (B^2 4*A*C) <= 0. (6+9) 6. a) What are logical, syntactic and execution errors? Give examples of each. Which is most difficult to find and why? b) Enumerate features of a good C program. Describe the commonly used techniques as to how C programs can be made highly readable and modifiable. c) What is an algorithm? Develop an algorithm to test whether a given number is a prime number. (5+5+5) 7. a) Develop loops using i) While statement ii) Do-while statement iii) For statement that will calculate the sum of every third integer, beginning with k=2 for all values of k <= 100. b) Write a function that will compute Y = X^n Where Y and X are floating point numbers and n is an integer number. Use this function and print the output X n Y Check for possible exceptions that may occur during computations with regard to the magnitude of computed values. (6+9) 8. a) How does an array differ from a structure? Give and explain the syntax of array and structure as defined in C. b) How are one-dimensional and two-dimensional arrays stored in computer memory? Illustrate with an example. c) Develop a program to multiply two matrices with sizes 3x4 and 4x5. Your program should take care of the fact that no element of either matrix can be negative. Include appropriate documentation. (6+2+7) 9. a) Give the main advantage of storing data as a file. Describe various ways in which data files can be categorized in C. Illustrate by examples. b) What is an indirection operator? Explain its usage to access a multidimensional array element. Illustrate your answer by an example. c) C compiler supports many pre-processor commands. Write their names only. (6+6+3) M4.1-R3 Page 5 of 5 January, 2009

M4.1-R3 Page 6 of 5 January, 2009