Tribhuvan University
Bachelor of Information Technology Management
Semester 1 · TU Board 2022
Course Title: C Programming (IT232)
Full Marks: 60Pass Marks: 30Time: 3 Hrs
Candidates are required to give their answers in their own words as for as practicable.
Group A
Brief Answer Questions(10 × 1 = 10)
- 1.1
Define algorithm.
- 2.1
List any two modes for opening a file.
- 3.1
What is the use of printf() function?
- 4.1
List arithmetic and logical operators available in C.
- 5.1
Define iteration.
- 6.1
Write a syntax to initialized 2D array in C.
- 7.1
What are the differences between array and structure?
- 8.1
What is the advantage of global variable?
- 9.1
What is the use of malloc() function?
- 10.1
Define string.
Group B
Short Answer Questions: (Attempt any FIVE Questions)(5 × 3 = 15)
- 11.3
Write a program to find the greatest of three number using functions. The function should expect three integers and return the greatest of them.
- 12.3
Read a string from the user and find the length of that sting using strlen() function.
- 13.3
Differentiate between while and do-while loop. Write a program to print the multiples of 5 less than 100.
- 14.3
Write a program that prints the following pattern: 1 1 2 1 2 3 1 2 3 4 1 2 3 5
- 15.3
Write a program to find the factorial of a number N read from the user using recursive function.
- 16.3
Write a program to sort the numbers in an array.
Group C
Long Answer Questions: (Attempt any THREE Questions)(3 × 5 = 15)
- 17.5
What does nested loop mean? Write a program to find the area of the rectangle after taking length and breadth as input from the user.
- 18.5
Write a program to read a string and copy it to another string in reverse format. Finally display the original string and the reversed string, without using string handling function.
- 19.5
Write a program to read an integer from the user. If the given integer is odd then write it into the file named "Odd.dat", otherwise write it into "Even.dat".
- 20.5
Give the syntax of the function in graphics that is used to draw a circle. Draw a flowchart to find the average of n numbers given by the user.
Group D
Comprehensive Answer / Case / Situation Analysis Questions(2 × 10 = 20)
- 21.10
What do you mean by enumerations? Explain call by value and call by reference. Write a program to swap two floating type numbers using call by reference.
- 22.10
Create a structure that can hold the information of Book with bookID, title and price. Read and store N books in "book.dat" from the user. Display the title of the books having price<1000.
— The End —