2057 Chaitra
2058 Chaitra
2058 Poush
2059 Chaitra
2059 Poush
2057 Chaitra IOE
Exam (057 Batch only) Regular Level B.E Full Mark 80 Programme BEX/BCT Pass Mark 32 Year/Part I/I Time 3 hrs TRIBHUVAN UNIVERSITY INSTITUE OF ENGINEERING Examination Control Division 2057 Chaitra Subject: - Computer Programming –I (EG 442 CT) Candidates are required to give their answers in their own words as far as practicable. Attempts All questions 1. a) What do you mean by computer software? Describe briefly about system software. [6] b) What is debugging and testing? How it is done? [4] 2. a) Write down the syntax, working and use of switch statement in ‘C’. [3] b)Write a computer program that asks the user to type in two integer values at the terminal. Test these two numbers to determine if the first is evenly (perfectly) terminal. [7] 3. a) What is the role of string handling functions in program coding? Explain with few examples only. [3] b)Write a computer program that reads in an integer value for n then sums the integers from n to 2n if n is non-negative, or from 2n to n if n is negative. Display the sum. [7] 4. a) What is a pointer? Where it is useful? [3] b) Write a computer program to find the product of all numbers from 1 to n using recursive function. [7] 5. a) Write briefly about Dynamic Memory Allocation? [4] b) Write a computer program to raise the power of each elements of given matrix of order PXQ by 3. Display the resultant matrix. [6] 6. Write a computer program to find the sum of all elements of an integer array of length k using the concept of both function and pointer. [10] 7. a) How do you relate array and pointer, illustrate with an example.[4] b) Write a program to read and display the Name, Address, Telephone number and Salary of an employee using structure. [6] 8. Write a computer program to copy the contents of one text file to another. The name of both files must be input by the user. Display appropriate message if source file does not exist. [10] ***
2058 Chaitra IOE
Exam (057 Batch only) Regular Level B.E Full Mark 80 Programme BEX/BCT Pass Mark 32 Year/Part I/I Time 3 hrs TRIBHUVAN UNIVERSITY INSTITUE OF ENGINEERING Examination Control Division 2058 Chaitra Subject: - Computer Programming –I (EG 442 CT) Candidates are required to give their answers in their own words as far as practicable. Attempts All questions The figures in the margin indicate Full Marks Assume suitable data if necessary 1. a) Briefly discuss different types of programming language and major features. [5] b) Write the algorithm and draw the flowchart to find the largest of three numbers. [5] 2. a) Describe how switch statement works. What are the restrictions on case labels [3+1] b) Write a program to count the number of odd and even number entered by the user. Your program must read numbers until the user enters zero. After user enters zero display the counts. [6] 3. a) Write about the return statement clearly stating different conditions that may arise when returning from a function. [4] b) Write a complete program that reads numerical values for x and n and evaluate the formula y=xn. Your program must have a function to calculate the result and return it. Assume both x and n are integer and you cannot use pow()function. [6] 4. a) What is the relation between a pointer and one-dimensional array? Describe with a simple example. [3] b) Write a program to read an array of two dimensional, double the content of each element of that array and display the result. Your program must have three functions read, process and to display to read, process and display the array. [7] 5. a) What is a structure? When do we use structure? [1+2] b) Write a program to create a structure containing members to store name, roll number and mark of one subject of a student. Test your structure by reading and displaying the data for ten students. [7] 6. a)Describe dynamic memory allocation functions available in C. b) Write a program that reads a string and convert all uppercase characters to lowercase and vice versa and display the string. 7. a) Why do we require to open a data file? How is this accomplished? b) Write a program to read name and roll number of 24 students from the user and store them in a file. If the file already contains data, your program should add new data at the end of the file. 8. Write a program that reads two one dimensional arrays of order m and n respectively and merge the Content of first and second array to third array of order (m+n) and display it. 6. Write a computer program to find the sum of all elements of an integer array of length k using the concept of both function and pointer. [10] 7. a) How do you relate array and pointer, illustrate with an example. [4] b) Write a program to read and display the Name, Address, Telephone number and Salary of an employee using structure. [6] 8. Write a computer program to copy the contents of one text file to another. The name of both files must be input by the user. Display appropriate message if source file does not exist. [10]
2058 Poush IOE
Exam (057 Back) Level B.E Full Mark 80 Programme BEX/BCT Pass Mark 32 Year/Part I/I Time 3 hrs TRIBHUVAN UNIVERSITY INSTITUE OF ENGINEERING Examination Control Division 2058 Poush Subject: - Computer Programming –I (EG 442 CT) Candidates are required to give their answers in their own words as far as practicable. Attempts All questions The figures in the margin indicate Full Marks Assume suitable data if necessary 1.a) What do you understand by Computer Generation? List salient features of each generation. [6] b) What is algorithm development & flowcharting ? What is its role in software development? [4] 2. a) Differentiate between macros and functions. Write their advantages and disadvantages. [3] b) Write a computer program that to display a table of numbers, its square value and its cube values from 1 to n-1, where n is any number typed by user at the terminal. [7] 3. a) What is the importance of string handling functions in ‘C’? where we use strcat and strcmp function. [3] b) Write a computer program to display a line of text “Programming is fun” 5 times using recursive function. [7] 4. a) Write short notes on “Function Prototype”. [3] b) Write a short program to read two integers n1 & n2. Display all even numbers between those two numbers.(n12059 Chaitra IOE
Exam Regular/Back(057 & Later Batches) Level B.E Full Mark 80 Programme BEX/BCT Pass Mark 32 Year/Part I/I Time 3 hrs TRIBHUVAN UNIVERSITY INSTITUE OF ENGINEERING Examination Control Division 2059 Chaitra Subject: - Computer Programming –I (EG 442 CT) Candidates are required to give their answers in their own words as far as practicable. Attempts All questions The figures in the margin indicate Full Marks Assume suitable data if necessary 1. a) Describe the major characteristics of different generations of computer. [5] b) Write the algorithm and flowchart for a program that checks whether the number entered by exactly divisible by 5 but not by 11. [5] 2. a) What data types and type qualifiers are available in C? Explain with examples. [2+2] b) Write a program that takes a string from the user and converts the string into uppercase if the first character lowercase and vice versa. [6] 3. a) Draw the flowchart of if..else statement and explain how it works. [1+2] b) Write a program to find the terms in the given series till the value of term is less than 1000. 1¬2+22 22+32 32+42 [7] 3 , 4 , 5 , 4. a) What is recursive function? What are its requirements? Explain with an example. [4] b) Write a program to read numbers until user enters zero. Your program should display the count of positive and negative numbers. [6] 5. a) How pointer and one dimension array are related with each other? Explain with example. [3] b) Write a function that takes one dimensional array of n numbers and sorts the elements in ascending order. Test the function in a program. [7] 6. a) Differentiate between while and do..while statement with example. [3] b) Create a structure containing processor, memory, HDD, monitor, casing as members. Use this structure in a program to read data for five different computers and display the data on the screen. [7] 7. a) Describe the three basic file operations. Write the statement used to open a file for this operations. [3] b) Write a program to open a new file. Read the name, address and telephone of ten persons from the user and write then to the file. After writing display the content of the file. [7] 8. Write a program that reads ‘n’ from the user and allocate memory to hold ‘n’ floating point numbers. User enters the numbers and your program should find the largest, smallest and mean of the numbers. [10]2059 Poush IOE
Exam Back-057 and Later Batch Level B.E Full Mark 80 Programme BEX/BCT/BEL Pass Mark 32 Year/Part I/I Time 3 hrs TRIBHUVAN UNIVERSITY INSTITUE OF ENGINEERING Examination Control Division 2059 Poush Subject: - Computer Programming –I (EG 442 CT) Candidates are required to give their answers in their own words as far as practicable. Attempts All questions The figures in the margin indicate Full Marks Assume suitable data if necessary 1. a) What is programming language? Explain its types. [1+4] b) What an algorithm and flowchart to check whether a number is exactly divisible by 3 but not by 2. 2. a) Explain operator precedence and associativity with suitable example. [5] b) Write a program that contains a structure to hold code, name, price and stock of a product in a supermarket. Assume suitable data types. Use the structure in a program to input the 50 data of such products and display them. [6] 3. a) What is the purpose of switch statement? Explain with example. [3] b) Write a program that will generate every third integer beginning with I=2 and continuing for all integers that are less than 100. calculate the sum of these numbers that are exactly divisible by 7. [7] 4. a) How does “for” statement differ from “while and do..while” statement? Explain [4] b) Write a program that takes a string and converts to uppercase if the first character is uppercase or to lowercase of the first character is lowercase. [6] 5. a) What is a function? What are its advantages? [1+2] b) Write a program that takes two integers, find their highest common factor and displays it. The highest common factor must be computed in a function called hcfactor. [7] 6. a) What is dynamic memory allocation? What library functions are used for this and what type of values do these functions return? [1+1+1] b) Write a program that allocates the memory space as required by the user for three arrays. User enters the numbers for two numbers for two arrays and the program sums the corresponding array elements and store them in the third array. [7] 7. a) Differentiate between file modes r+ and w+. [3] b) Write a program that reads characters from keyboard and writes to a data file. The program should display the numbers of words entered and terminate when the user enters a dot. [7] 8. Write a program that reads numbers until the user enters a negative number. The Program should check all the numbers whether it is prime or not. If a number is Prime the program should display the number and at the last display the count of prime numbers entered. [10]
Read more!