#1
| |||
| |||
![]()
Will you please give me DOEACC - O level, M4.1-R3 Programming & Problem Solving Through "C" previous years question papers?
|
#2
| |||
| |||
![]()
As you want to get DOEACC - O level, M4.1-R3 Programming & Problem Solving Through "C" previous years question papers so here is the information of the same for you: DOEACC - O level, M4.1-R3 Programming & Problem Solving Through "C" previous years question papers 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 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( ) { inta[ ]={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 Y 3.1 The operator && is an example of A. Arrays 3.2 Preprocessor commands are always preceded by B. Storage class 3.3 Header files in ‘C’ contain C. /0 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 G. Masking 3.8 An example of unconditional control structure is 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 Xn 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 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 Which of the following is a valid octal constant? A) 32 B) 032 C) 049 D) 0x49 1.2 Which of the following switch statement is not a valid statement to print “RED” if a character variable ‘color’ has the value ‘R’ or ‘r’? A) switch (color) { case ‘R’: case ‘r’: printf(“RED”); break; } B) switch (color) { case ‘R’: printf(“RED”); break; case ‘r’ : printf(“RED”); break; } C) switch (toupper(color)) { case ‘R’: printf(“RED”); break; } D) switch (color) { case ‘R’ || ‘r’ : printf(“RED”); break; } 1.3 What will be the output of the following code segment, if the function is called as larger(10, 20) ? int larger(int x, int y) { int max = x; if (max < y) { max = y; return y; } else return x; printf(“Larger of %d and %d is %d”, x, y, max); } M4.1-R3 Page 1 of 6 July, 2007 A) Program will not compile as the function has two return statements. B) Program will not compile as no statement is allowed after return statement. C) Larger of 10 and 20 is 20. D) No output. 1.4 Given the code segment: char a[] = “abc”, *p; Which of the following assigns the starting address of the string “abc” to p? A) p=a; B) p=&a; C) p=*a; D) *p=a; 1.5 To read and write an existing file without overwriting, the following mode is uded. A) r B) w C) r+ D) w+ 1.6 If an array is defined as static char a[10]; then the elements of a will be set to A) an undetermined value B) zero C) blank character D) character ‘~0’ 1.7 For the code segment struct DOB { int date, month, year;}; struct person { char name[30]; struct DOB birthdate; } p, *ptr = &p; Which of the following is not a valid expression to access year of birth date? A) ptr -> birthdate.year B) (*ptr). birthdate.year C) ptr.birthdate.year D) p.birthdate.year 1.8 Which of the following statement is false for the statement? main(int ac, char *av[]) A) av is an array of pointers to strings. B) av[0] represents the name of the program under execution. C) the formal arguments names have to be argc and argv only. D) the main function can return an integer to the calling function/program. 1.9 What will be the output of the following? main() { int a=‘A’; printf(“%d”, a); A) 65 B) A C) a D) the program will not compile as an integer variable is assigned a character constant. M4.1-R3 Page 2 of 6 July, 2007 1.10 Consider the following code segment: for (odd_sum = 0, j = 1; *** ; j += 2) odd_sum += j; In order to sum all the odd numbers between 1 to 100; which of the following statements cannot replace ***? A) j<=99 B) j<99 C) j<=100 D) j<100 M4.1-R3 Page 3 of 6 July, 2007 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 An escape sequence begins with a backward slash followed by an alphabetical character. 2.2 The for loop can be used only for the cases when the number of passes is known in advance. 2.3 Let an array arr be a member of a structure s. If s is passed to a function, test as test(s), then the changes in arr, if any, by test will not be reflected in the calling function. 2.4 In a recursive function with local variables, a different set of local variables with the same name are created during each call. 2.5 Two enumeration constants defined in an enumeration definition can have same integral value. 2.6 The sizeof operator can only be used with variables that are allocated space using malloc() function. 2.7 If u is a union variable, then using isalpha(u) it is possible to know whether u is storing an alphabet or not. 2.8 If a file is created with fwrite() function, then it is valid to read it using fscanf() function. 2.9 NULL is a keyword in C. 2.10 A function name can be passed as an argument to another function. 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 Y 3.1 Self referential data structure A. Arrays 3.2 Converting to a different data type B. Flowchart 3.3 Creating new data type C. while(0) 3.4 Removing repetitive coding D. Register variables 3.5 Infinite loop E. Recursion 3.6 Pictorial representation of logic F. Function 3.7 Request to compiler G. Declaration 3.8 Defining constants H. typedef 3.9 Global variables I. #define 3.10 Space allocation to variables J. Static K. Algorithm L. Linked lists M. type casting N. Definition O. External variables P. for(; ![]() M4.1-R3 Page 4 of 6 July, 2007 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. actual B. 4 C. character D. false E. self-referential structure F. formal G. stream oriented H. heterogeneous I. declaration J. 1 K. 5 L. text M. unknown N. non linear O. union P. pointer Q. 0 R. linear S. sparse array T. true U. unformatted V. definition W. Integer X. linked list 4.1 The data structure with most of the entries as 0 (zero) is a(n) ________. 4.2 A null terminated array of ________ is a string. 4.3 A constant can be valid ________ argument to a function. 4.4 The statement struct point { int x, y;}; is a structure ________. 4.5 Linked list is a ________ data structure. 4.6 The expression pv + 3 is valid but not pv *3 if pv is a(n) ________ variable. 4.7 A(n) ________ file can be created with specially written program only. 4.8 The size of an array defined as char color[] = “BLUE”; is ________. 4.9 In expression ((j + k > 10) || (n > -3)), (n > -3) will be evaluated if (j + k > 10) is ________. 4.10 The loop do { … } while (0); will be executed ________ times. M4.1-R3 Page 5 of 6 July, 2007 PART TWO (Answer any FOUR questions) 5. a) Write a ‘C’ program to compute the following series: 1 – x + x2/2 – x3/6 + x4/24 + + (-1)nxn/n! Where n and x is to be accepted by the user. b) Develop a flowchart and then write a ‘C’ program to sort strings passed to the program through the command line arguments. Also display the sorted strings. (6+9) 6. a) Define a structure to store roll_no, name and marks of a student. b) Using the structure of Q6. a), above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user. c) Using the “student.dat” of Q6. b), above write a ‘C’ program to search for the details of the student whose name is entered by the user. (3+6+6) 7. a) Write a ‘C’ function to reverse a singly linked list by traversing it only once. b) Write a ‘C’ function to remove those nodes of a singly linked list which have duplicate data. Assume that the linked list is already in ascending order. (7+8) 8. a) What do you understand by loading and linking of a program? b) Write a ‘C’ function to generate the following figure for n = 7. 1 13 135 1357 135 13 1 The value of n is passed to the function as an argument. Print the triangle only if n is odd otherwise print an error message. c) Write a ‘C’ function to arrange the elements of an integer array in such a way that all the negative elements are before the positive elements. The array is passed to it as an argument. (3+6+6) 9. a) Write a recursive function in ‘C’ to count the number of nodes in a singly linked list. b) Develop a flowchart and then write a ‘C’ program to add two very large positive integers using arrays. The maximum number of digits in a number can be 15. (5+10) M4.1-R3 Page 6 of 6 July, 2007 Contact Details: National institute of Electronics and Information Technology Sco No. 114-116, Sector 17 B, Backside KC Cinema, Chandigarh, 160017, 0172 270 3281 India Map Location:
__________________ Answered By StudyChaCha Member |
#4
| |||
| |||
![]()
As you want previous year question papers of DOEACC - O level, M4.1-R3 Programming & Problem Solving Through "C" Language, so here I am providing following papers: DOEACC - O Level M4.1-R3 Programming & Problem Solving Through "C" Question Paper 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.1 What would be value of j after the following is executed? k=17; j=6; if (k < 10) j=8; j=j+1; j=j+2; A) 8 B) 9 C) 7 D) 10 1.2 What will be output after compilation and execution of the following code? #include int main(){ int array[3]={5}; int i; for (i=0;i<=2;i++) printf("%d ",array[i]); return 0;} A) 5 garbage garbage B) 5 0 0 C) 0 0 0 D) 5 5 5 1.3 In an assignment statement a=b; which of the following statement is true? A) The variable a and the variable b are same. B) The value of b is assigned to variable a but if b changes later, it will not effect the value of variable a. C) The value of b is assigned to variable a but if b changes later, it will effect the value of variable a. D) The value of variable a is assigned to variable b, and the value of variable b is assigned to variable a. 1.4 Which code will print k 20 times? A) for (i=1; i < 20; i++) printf (“k”); B) for (i=1; i = 20; i++) printf (“k”); C) for (i=0; i < 20; i++) printf (“k”); D) for (i=0; i <= 20; i++) printf (“k”); 1.5 When the following piece of code is executed, what happens? b = 3; a = b++; A) a contains 3 and b contains 4 B) a contains 4 and b contains 4 C) a contains 4 and b contains 3 D) a contains 3 and b contains 3 1.6 What is the value of r after this code is executed? r=2; k=8; if (r>3 || k>6 && r<5 ||k>10) r=9; else r=6 A) 9 B) 2 C) 6 D) 8 DOEACC - O Level M4.1-R3 Programming & Problem Solving Through "C" Question Paper ![]() ![]() ![]() ![]() ![]()
__________________ Answered By StudyChaCha Member Last edited by Aakashd; August 13th, 2018 at 12:17 PM. |