Vous êtes sur la page 1sur 2

SET A ORCHID INTERNATIONAL COLLEGE

Bijayachowk, Gaushala-9, Kathmandu


Full Marks: 60
Pre-Board Examination – 2075 Pass Marks: 30
Bachelor Level / First Year/ First Semester/ Science Time: 3 hour
Computer Science and Information Technology (CSC.110)
(C. Programming)
Candidates are required to give their answer in their own words as far as practicable.
Section "A"
Long Answer Questions (Attempt any Two questions) [2 ×10= 20]
1. What are the purpose of algorithm and flowchart? Write a program to read and display the information
of a Student (studentID, fullName, email, gender and dateOfBirth). The dateOfBirth is of Date type
(day, month, and year). Use the concept of nested structure and pass by reference.
2. Explain the use of strlen(), strcpy() string handling functions. Write your own program that reads a
string and calculates the length of the string without using string handling functions.
3. Differentiate calloc() and malloc(). Write the general syntax or pseudocode to allocate memory for N
number of Student as in question 1.
Section "B"
Short Answer Questions (Attempt any Eight questions) [8×5=40]
4. How is an array different than a normal built-in type of variable? Read an array of 10 integer values
and pass it to a UDF that finds the mean. Finally, print the mean from the main body. [2+3]
5. Differentiate while and do-while loop along with a simple program of your own choice. [2+3]
6. What do you mean by recursive function? Write a program to find the permutation P(n,r). Use
recursion to calculate the factorial. [P(n, r) = n! / (n-r)! ] [2+3]
7. What are various logical operators? WAP in C to demonstrate the use of bitwise left shift operator.
[2+3]
8. What are the uses of strcat() and strcmp() functions in C? Write a program in C to display all the
characters read from the keyboard in upper case, until the user enters ‘@’ sign. [2+3]
9. What is the difference between structure and union in C? Explain it through any example of your
own choice. [2+3]
10. What are the various modes in which binary files can be opened? Assume the Student record as in
question 1 to be stored in student.bin. Display the information of those students who are male.
[2+3]
11. Explain initgraph(), line, outtextxy(), setcolor(), getmaxx() and getmaxy() and all its arguments (if any).
[2+3]
12. Print the following pattern: [5]

1
1 1
1 1 1
1 1 1 1
ORCHID INTERNATIONAL COLLEGE SET B
Bijayachowk, Gaushala-9, Kathmandu
Full Marks: 60
Pre-Board Examination – 2075 Pass Marks: 30
Bachelor Level / First Year/ First Semester/ Science Time: 3 hour
Computer Science and Information Technology (CSC.110)
(C. Programming)
Candidates are required to give their answer in their own words as far as practicable.
Section "A"
Long Answer Questions (Attempt any Two questions) [2×10 = 20]
1. What are the similarities and differences between array and structure? Write a program to read the
information of an Employee (empID, fullName, designation, salary, dateOfJoining) and display it. The
dateOfJoining is of Date type (day, month, and year). Use the concept of nested structure.
2. Explain each built-in functions used in DMA. Write the general syntax for allocating memory on
runtime for N number of floating type array using calloc().
3. Explain bitwise right-shift operator. Write a simple program to demonstrate the use of nested for loop.
Section B
Short Answer Questions (Attempt any Eight questions) [8×5=40]
4. What is the use of break, and continue; statement? Draw flowchart and write program in C to find
the simple interest. [2+3]
5. Differentiate between compiler and interpreter. What is the importance of program documentation in
a C program? [2+3]
6. Describe NULL pointer. Write a program in C to swap two floating type values using the concept of
pass by reference. [2+3]
7. What do you mean by enumeration and macros? Write a simple program in C to implement cube of
any number using the concept of macro. [2+3]
8. How can graphics be initialized in C? Explain line(), circle() and rectangle() graphical functions along
with their general syntax. [2+3]
9. Distinguish between the while and do-while loop. Write a program in C to find the sum of squares of
N natural numbers using for loop. Read the value of N interactively. [2+3]
10. How do you initialize a structure variable? Read and display information of 5 books (bookID, title,
cost and edition). Use user defined functions to read and display the information. [2+3]
11. What are the uses of strcpy() and strcmp() functions. Write a program in C to read a string and a
character from the user interactively. The UDF must be used to calculate total number of
occurrences of the character in the string. Finally, the count should be displayed in the main body.
[2+3]
12. What are the various modes in which a file can be opened? Assuming the Employee structure as in
question 1, stored in a record file employee.dat, display the information of employees earning not
less than 50000 in a well formatted way. [2+3]

Vous aimerez peut-être aussi