TRIBHUVAN UNIVERSITY
INSTITUTE OF SCIENCE AND TECHNOLOGY
2080 B.S.
Candidates are required to give their answers in their own words as far as practicable.
Group A
Long Answer QuestionsAttempt any Two questions.
- 1Define structure and nested structure. Write a program to find out whether the nth term of the Fibonacci series is a prime number or not. Read the value of n from the user and display the result in the main function. Use separate user-defined function to generate nth Fibonacci term and to check whether that number is prime or not. (3+7)
- 2Explain the relation to array and pointer. Differentiate between call by value and call by reference with a suitable program. (2+8)
- 3Differentiate between source code and object code. Create a structure named Book with members Book_Name, Price and Author_Name, then take input for 10 records of Book and print the name of authors having the price of book greater than 1000. (3+7)
Group B
Short Answer QuestionsAttempt any Eight questions.
- 4Describe the different types of I/O functions used in file handling with syntax. (5)
- 5Write a program to read $P imes Q$ matrix of integers and find the largest integer of each row and display it. (5)
- 6Write a program to calculate the factorial of a given number using recursion. (5)
- 7Write a program to check whether the entered word is palindrome or not. (5)
- 8List different types of operators and explain any three of them. (5)
- 9Trace the output: #include <stdio.h> void main() { int i=0, k; for (k=5; k>=0; k--) { i=i+k; printf("%d ", i); } } (5)
- 10Write a program to compute the sum of first 10 even numbers using function. (5)
- 11What is dynamic memory allocation? Explain with a suitable program. (5)
- 12Write a program to initialize an array of dimension 10 and sort the numbers within the array in ascending order. (5)