0% found this document useful (0 votes)
19 views4 pages

BCA C Programming Model Test Papers

The document contains model test papers for a BCA course on Problem Solving Using C, including instructions for candidates and two sections of questions. Section A consists of compulsory short answer questions, while Section B includes longer questions that students must choose from. Topics covered include data types, storage classes, file operations, and various programming concepts in C.

Uploaded by

gjjdike
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

BCA C Programming Model Test Papers

The document contains model test papers for a BCA course on Problem Solving Using C, including instructions for candidates and two sections of questions. Section A consists of compulsory short answer questions, while Section B includes longer questions that students must choose from. Topics covered include data types, storage classes, file operations, and various programming concepts in C.

Uploaded by

gjjdike
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Model Test Paper-1

BCA (2021 Onwards) (Sem.- 1)


PROBLEM SOLVING USING C
Subject Code: UGCA 1903
Time: 3 Hrs Max Marks: 60

Instructions to Candidates:
1. SECTION-A is Compulsory consisting of TEN questions carrying TWO marks
each.
2. SECTION-B contains SIX questions carrying TEN marks each and students have to
attempt any FOUR questions.

Section- A
1. Write briefly

a. Exemplify identifiers & Keywords


b. List our various symbols of flowchart.
c. Describe header files. Why are these required?
d. Define pointer. How the variable can be assessed using pointer.
e. Compare ‘B’ & “B”.
f. Illustrate formate I/O function in C.
g. How 1-D & 2-D arrays are declared? Give example.
h. Differentiate local & global variables with example.
i. Discuss the structure of C Programs.
j. List out various file operations in C.
Section- B

2. Explain various data types of ‘C’ with Example. Give memory requirement of each.
3. Illustrates storage class. Explain the different types of storage classes with suitable example
of each.
4. Write a ‘C’ program to
a. Calculate factorial of a given number.
b. Print Fibonacci series upto n terms.
5. Describe structure. How it is declared & accesses? Discuss How a structure is different from
Union?
6. Differentiate with example
a. While & do-while
b. Call by value & call by reference
7. Exemplify different types of file operations in ‘C’ language. Discuss each with suitable
examples.
Model Test Paper-2
BCA (2021 Onwards) (Sem. - 1)
PROBLEM SOLVING USING C
Subject Code: UGCA 1903
M. Code: 76963
Time: 3 Hrs Max Marks: 60

Instructions to Candidates:
1. SECTION-A is Compulsory consisting of TEN questions carrying TWO marks
each.
2. SECTION-B is contains SIX questions carrying TEN marks each and students have
to attempt any FOUR questions.

Section- A
1. Write briefly

a. List out the basic data types associated with C.

b. Describe the difference between = and == symbols in C.

c. Illustrates the purpose of break statement and give a suitable example.

d. Implement a program to print average of first 10 numbers.

e. How is a program compiled & executed?

f. Exemplify sizeof() operator in C.

g. Mention the various looping statements supported by C

h. State ternary operator with program code.

i. Compare algorithm & flowchart.

j. Demonstrate text files & binary files in C.

Section- B

2. Elaborate the term expression and operator? Explain various types of operators available in C
language.
3. Implement a C Program

a. To multiply any two 3X3 matrices.

b. Using the pointer to find largest element of array.

4. Describe flow chart. List out various symbols of flow chart. Draw the flow chart to find sum

of numbers divisible by 5 in range of 1 to 500.

5. Explain the following

a. Switch Statement in C
b. Macros in C

6. Write brief notes on

a. String handling functions in C

b. Passing arrays to a function

7. Implement C Program:

a. To check given number is palindrome or not.

b. To calculate the factorial of given number.


Model Test Paper-3
BCA (2021 Onwards) (Sem. - 1)
PROBLEM SOLVING USING C
Subject Code: UGCA 1903
M. Code: 76963
Time: 3 Hrs Max Marks: 60

Instructions to Candidates:
1. SECTION-A is Compulsory consisting of TEN questions carrying TWO marks
each.
2. SECTION-B is contains SIX questions carrying TEN marks each and students have
to attempt any FOUR questions.

Section- A
1. Write briefly
a. Differentiate = and == symbols in C.
b. Keywords v/s Indentifiers.
c. Purpose of break statement.
d. Distinguish between structure and union.
e. Initialization of arrays.
f. Symbolic constants.
g. Storage classes in C.
h. Recursion.
i. Formatted I/O functions in C.
j. Operator’s precedence.

Section-B
2. Write down the different options for writing formatted and unformatted functions in I/O
statements in a C-program.
3. Briefly explain Functions. How they declared and passed as an argument? Differentiate
call by value and call by reference.
4. Elaborate advantages of using array. Discuss about multidimensional array and its storage
in memory. Explain the concept of passing array to function with suitable example.
5. Exemplify operators and expressions in C with example.
6. Illustrate string handling functions with example.
7. Discuss file handling operations in detail.

Common questions

Powered by AI

In C, '=' is the assignment operator used to assign a value to a variable, whereas '==' is the equality operator used to compare two values for equality within expressions. The '=' operator changes the state of a variable by copying the right-hand side value into the left-hand side variable. On the other hand, '==' evaluates to true if the operands are equal, otherwise, it evaluates to false, and is often used in control statements like if-else, loops, etc., to make decisions based on conditions .

C language provides several file operations managed using file pointers. Key operations include fopen() for opening files, fclose() for closing, fprintf()/fscanf() for formatted I/O, fread()/fwrite() for binary I/O, and fseek() for file pointer manipulation. fopen() sets file mode actions—e.g., 'r', 'w', 'a'. Reading/writing uses fscanf()/fprintf() for text, fread()/fwrite() for binary, providing flexibility in handling different file types. For instance, 'FILE *fp = fopen("file.txt", "r");' opens a text file for reading .

Pointers are variables that store the memory address of another variable, declared using the asterisk (*) symbol. Unlike simple variables that store data values, pointers are used for dynamic memory allocation, passing large data structures to functions efficiently, and constructing complex data structures like linked lists. Pointers enable manipulation of memory directly and provide the capability to interact closely with hardware, making them powerful tools in programming, albeit with increased complexity and potential for errors like segmentation faults .

Local variables are declared within a block or function and can only be accessed within that scope; they are created at the start and destroyed at the end of the block or function, preventing accidental interference with other program parts. Global variables are declared outside of any function and accessible from any function within the program file, maintaining their values throughout the program's execution. For example, 'int x = 10;' declared outside all functions is global, while 'int y = 5;' within the main function is local, differing in accessibility and duration .

Identifiers in C are names given to variables, functions, arrays, etc., and consist of alphabets (both uppercase and lowercase), digits, and underscores, but must begin with an alphabet or an underscore and are case-sensitive. Keywords are reserved words in C that have a predefined meaning and cannot be used as identifiers. This distinction is important for program compilation because using keywords as identifiers would lead to syntax errors since the compiler expects specific meanings from these reserved words, impacting how the program is translated into machine code .

A C program typically begins with preprocessor directives, including header files, followed by global declarations, the main function, and any user-defined functions. Header files provide declarations for library functions and macros, enabling code modularity, reuse, and maintainability. They allow the programmer to use standard library functions such as IO operations without redefining them, thus streamlining the development process .

The switch statement in C evaluates an expression and executes a block of code associated with matching cases. Syntax: 'switch(expression) { case constant1: //code; break; ... default: //default code; }'. Each case must end with 'break' to prevent fall-through. Advantages over if-else include better readability and organization when handling multiple conditions of a single variable, making code more efficient by evaluating the expression once. However, switch is limited to discrete values, unlike if-else handling complex conditions .

C provides four storage classes: auto, register, static, and extern. 'auto' is the default storage class for local variables, stored in the stack with automatic duration. 'register' hints the compiler to store variables in CPU registers for quicker access, used for frequently accessed variables. 'static' extends local variables' lifetime beyond a single function call, maintaining values through multiple calls. 'extern' is used to declare global variables accessible across multiple files. These classes determine variable scope, visibility, and lifespan, crucial for resource management in complex programs .

The 'while' loop checks the condition before executing the loop block, ensuring the block executes only if the condition is true. Syntax: 'while(condition) { //code }'. The 'do-while' loop executes the block at least once, checking the condition after execution, making it suitable when the code needs to run regardless of the initial condition. Syntax: 'do { //code } while(condition);'. This behavior differs in guaranteeing at least one execution iteration in 'do-while', suitable for menu-driven programs requiring at least one menu display .

In C, a one-dimensional array is declared using the syntax 'datatype arrayName[arraySize];'. For example, 'int arr[10];' declares an array of 10 integers. A two-dimensional array uses the syntax 'datatype arrayName[rowSize][colSize];'. For instance, 'int arr[3][4];' declares a 2D array with 3 rows and 4 columns. In memory, a 1D array is stored linearly, while a 2D array is stored in row-major order (all elements of a row are stored in contiguous memory locations), enabling efficient access and manipulation of array elements .

You might also like