0% found this document useful (0 votes)
20 views3 pages

BCA Problem Solving Techniques Test

The document outlines the internal assessment test for the Problem Solving Techniques course at Jyothy Institute of Commerce and Management for BCA students. It includes questions on algorithms, variables, data types, input/output functions, and C programming concepts, with sections divided into different mark allocations. The test covers theoretical and practical aspects of programming, including problem-solving steps and asymptotic notations.

Uploaded by

xoxunique00
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)
20 views3 pages

BCA Problem Solving Techniques Test

The document outlines the internal assessment test for the Problem Solving Techniques course at Jyothy Institute of Commerce and Management for BCA students. It includes questions on algorithms, variables, data types, input/output functions, and C programming concepts, with sections divided into different mark allocations. The test covers theoretical and practical aspects of programming, including problem-solving steps and asymptotic notations.

Uploaded by

xoxunique00
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

Jyothy Institute of Commerce and Management

I Internal Assessment Test – September 2025


Subject: Problem Solving Techniques
Course: I Semester BCA
Time: 1 Hour 30 Minutes Max Marks: 40

SECTION – A (3 × 2 = 6 Marks)
Answer any three questions. Each carries 2 marks.

1) Define an algorithm. Mention any two types.


An algorithm is a step-by-step procedure or set of rules designed to perform a specific task or solve
a problem.
Types:
1. Iterative Algorithm – Uses looping until a condition is met.
2. Recursive Algorithm – Calls itself to solve smaller sub-problems.

2) What is a variable? How do we declare a variable?


A variable is a named memory location used to store data values that may change during program
execution.
Declaration Syntax:
datatype variable_name;
Example:
int age;
float salary;

3) List two types of Input and Output functions.


Input functions: scanf(), getchar()
Output functions: printf(), putchar()

4) Mention any four format specifiers with their meaning.


%d – Integer value
%f – Floating-point number
%c – Single character
%lf – Double-precision floating-point number

SECTION – B (3 × 6 = 18 Marks)
Answer any three questions. Each carries 6 marks.

5) Write an algorithm to find the factorial of a given number.


Algorithm:
1. Start
2. Read number n
3. Initialize fact = 1
4. Repeat from i = 1 to n → fact = fact * i
5. Print fact
6. Stop
Example: For n = 5, fact = 120

6) What is a datatype? Explain different datatypes with examples.


A datatype defines the type of data that can be stored in a variable.
Types:
1. Basic: int, float, char, double
2. Derived: Arrays, Pointers, Structures
3. Enumeration (enum): Defines named constants
4. Void: Represents no value

7) Explain the different steps involved in problem solving.


1. Problem Definition
2. Analysis
3. Design
4. Coding
5. Testing and Debugging
6. Documentation and Maintenance

8) Explain about the basic structure of a C program.


#include <stdio.h>
int main() {
// Variable declaration
// Statements
return 0;
}
Parts:
1. Preprocessor Directive
2. main() Function
3. Variable Declarations
4. Statements/Logic
5. Return Statement

SECTION – C (2 × 8 = 16 Marks)
Answer any two questions. Each carries 8 marks.

9) Explain about Asymptotic notations.


Asymptotic notation describes the efficiency of an algorithm based on input size.
Types:
Big O (O): Worst case
Omega (Ω): Best case
Theta (Θ): Average case

10) Write a C program to find the reverse of a number and check whether it is palindrome or
not.
#include <stdio.h>
int main() {
int n, rev=0, rem, temp;
printf("Enter a number: ");
scanf("%d", &n;);
temp = n;
while(n != 0) {
rem = n % 10;
rev = rev * 10 + rem;
n = n / 10;
}
printf("Reversed number: %d\n", rev);
if(temp == rev)
printf("The number is a palindrome.\n");
else
printf("The number is not a palindrome.\n");
return 0;
}

11) What is an operator? Explain about different C operators.


An operator is a symbol that performs operations on operands.
Types:
Arithmetic: +, -, *, /, %
Relational: ==, !=, >, <, >=, <=
Logical: &&, ||, !
Assignment: =, +=, -=, *=, /=, %=
Increment/Decrement: ++, --
Bitwise: &, |, ^, ~, <<, >>
Conditional: ?:
Special: sizeof, &, *, ->

Common questions

Powered by AI

The C program determines if a number is palindromic by first reversing the digits of the number and then comparing the reversed number to the original. The program uses a loop to extract digits by taking the modulus of 10, constructs the reversed number by multiplying the current reversed value by 10 and adding the digit, and then divides the number by 10 to process the next digit. This illustrates concepts like iteration, conditional checking, and arithmetic manipulations in algorithms .

Format specifiers in C are crucial for correctly reading and displaying different data types during input and output operations. They indicate how data should be formatted and interpreted. For example, %d is used for integer values, %f for floating-point numbers, %c for single characters, and %lf for double-precision floating-point numbers. These specifiers ensure that data is accurately processed and presented according to its type, preventing errors and misinterpretations in I/O functions .

Operators in C programming are symbols that perform specific operations on given operands. Different types include: Arithmetic operators (+, -, *, /, %), Relational operators (==, !=, >, <, >=, <=), Logical operators (&&, ||, !), Assignment operators (=, +=, -=, *=, /=, %=), Increment/Decrement operators (++/--), Bitwise operators (&, |, ^, ~, <<, >>), Conditional (ternary) operator (?:), and Special operators like sizeof, address (&), indirection (*), and member selection via pointer (->).

Variables in C programming are declared by specifying a datatype followed by a variable name, e.g., 'int age;'. The declaration reserves memory for storing values of the specified data type. Initialization refers to the assignment of a preliminary value to a variable at the time of its declaration, e.g., 'int age = 30;'. This ensures that variables have defined states before their use, minimizes errors related to undefined or garbage values, and facilitates predictable program behavior .

Data types in C programming define the type of data that can be stored in a variable and the operations that can be performed on it. They are categorized as basic types such as int, float, char, double; derived types like arrays, pointers, and structures; enumeration types for defining named constants; and the void type for representing no data. Each type dictates how variables are declared, how much memory they occupy, and how data is manipulated within the program .

The basic structure of a C program includes several parts: the preprocessor directive, which manages library dependencies; the main() function, which is the entry point of the program; variable declarations that allocate memory for program data; statements or logic that perform the actual computations; and the return statement, which indicates the program's termination. This structure facilitates organized code execution and effective management by clearly separating concerns and defining a sequential flow .

An iterative approach is suggested for calculating the factorial of a number. The algorithm involves initializing a factor variable to 1, looping from 1 to the number n, multiplying the factor by the loop variable in each iteration, finally printing the factorial. This method illustrates how iterative processes are used to perform repeated tasks efficiently until a condition is met, showcasing the principle of looping in algorithm design .

An algorithm is a step-by-step procedure or set of rules designed to perform a specific task or solve a problem. The key characteristics include its structured approach to problem-solving and the ability to be implemented in various scenarios. Two types mentioned are iterative algorithms, which use loops until a condition is met, and recursive algorithms, which call themselves to solve smaller sub-problems .

Asymptotic notation is used to describe the efficiency of an algorithm, particularly in terms of time complexity, based on the input size. The types of asymptotic notation are Big O (O), which represents the worst-case scenario; Omega (Ω), which represents the best-case scenario; and Theta (Θ), which denotes the average case scenario of an algorithm's performance .

The fundamental steps involved in the problem-solving process include: 1) Problem Definition, where the problem is clearly defined; 2) Analysis, which involves understanding the requirements and constraints; 3) Design, which outlines the algorithm plan; 4) Coding, the process of translating the algorithm into a programming language; 5) Testing and Debugging, which involves verifying the algorithm and fixing any errors; 6) Documentation and Maintenance, ensuring that the solution is properly documented for future reference and improvements .

You might also like