Bachelors Level/First Year/First Semester/Science csit/first semester/c programming/syllabus wise questions

B.Sc Computer Science and Information Technology

Institute of Science and Technology, TU

C Programming (CSC115)

Year Asked: 2080, syllabus wise question

Arrays
1.
Explain the relation to array and pointer. Differentiate between call by value and call by reference with a suitable program. [2+8]
2.
Write a program to read P*Q matrix of integers and find the largest integer of each row and display it. [5]
3.
Write a program to initialize an array of dimension 10 and sort the numbers within the array in ascending order. [5]
Control Statement
1.
Write a program to check whether the entered word is palindrome or not. [5]
2.
Trace the output
#include <conio.h>\texttt{\#include }
#include <stdio.h>\texttt{\#include }
void main() {\text{void main() \{}
int i = 0, k;\text{int i = 0, k;}
for (k = 5; k >= 0; k–) {\text{for (k = 5; k >= 0; k--) \{}
i = i + k;\text{i = i + k;}
}\text{\}}
printf("%d\t", i);\texttt{printf("\%d\textbackslash t", i);}
getch();\text{getch();}
}\text{\}}
[5]
File Handling in C
1.
Describe the different types of I/O functions used in file handling with syntax. [5]
Functions
1.
Write a program to calculate the factorial of a given number using recursion. [5]
2.
Write a program to compute the sum of first 10 even numbers using function. [5]
Operators and Expression
1.
List different types of operators and explain any three of them. [5]
Pointers
1.
What is dynamic memory allocation? Explain with a suitable program. [5]
Structure and Union
1.
Define structure and nested structure. Write a program to find out whether the nthn^{th} 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 (i) generate nthn^{th} term and (ii) to check whether that number is prime or not. [3+7]
2.
Differentiate between source code and object code. Create a structure named Book which remembers Book_Name, Price and Author. Then, make the list of top 10 records of book and print the name of authors having the price of book greater than 1000. [3+7]