BT0065, C Programming and Data Structures

Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
“ help.mbaassignments@gmail.com ”
or
Call us at : 08263069601


ASSIGNMENT

PROGRAM
B.SC IT
SEMESTER
FIRST
SUBJECT CODE & NAME
BT0065, C Programming and Data Structures
CREDIT
3
BK ID
B0949
MAX.MARKS
60


Note: Answer all questions. Kindly note that answers for 10 marks questions should be approximately of 400 words. Each question is followed by evaluation scheme.

Q.1 Explain the structure of the C program.

Answer: A C program basically has the following form:
·         Preprocessor Commands
·         Functions
·         Variables

Q.2 Explain bubble sort with the help of an example.

Answer: Bubble sorting is one of the simplest sorting algorithm that we can use to sort an array or a structure. Though it is so simple to implement in a C program, bubble sort is also considered as an inefficient sorting algorithm. Bubble sort comes handy in cases where the total number of elements to be sorted is so small (may be in the 100’s range). When the data size is large/huge bubble sort is seldom used in practical programming world. Let’s analyse bubble sort algorithm in detail by implementing it as a C program.




Q.3 What is structure? What is its importance? Explain with an example how to declare and initialize structure.

Answer: A structure is a collection of variables under a single name. These variables can be of different types, and each has a name which is used to select it from the structure. A structure is a convenient way of grouping several pieces of related information together.

A structure can be defined as a new named type, thus extending the number of available types. It can use other structures, arrays or pointers as some of its




Q.4 Explain all file open functions with examples.

Answer: File handling is a core concept in programming language.

File handling functions
fopen()
FILE *fopen(const char *path, const char *mode);
The fopen() function is used to open a file and associates an I/O stream with it. This function takes two arguments. The first argument is a pointer to a string containing name of the file to be opened while the second argument is the mode in which the file is to be opened. The mode can be :
·         ‘r’    :  Open text file for reading. The stream is

Q.5 Write a program to implement stack using arrays.

Answer:
#include
#define SIZE 4
void push();
void pop();



Q.6 Write an algorithm for selection sort. Sort the list given below in ascending order by using this sorting technique.64 ,25, 12, 22 , 11

Answer: Selection sort is a sorting algorithm, specifically an in-place comparison sort. It has O(n2) time complexity, making it inefficient on large lists, and generally performs worse than the similar insertion sort. Selection sort is noted for its simplicity, and it has

Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
“ help.mbaassignments@gmail.com ”
or
Call us at : 08263069601


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.