Solved Computational Thinking Paper
Solved Computational Thinking Paper
Testing is the process of evaluating a system or its components with the intent to find
whether it satisfies the specified requirements or not. It helps identify errors, gaps,
or missing requirements.
Types of Testing:
1. Unit Testing
2. Integration Testing
3. System Testing
4. Acceptance Testing
(b) What is a variable? Define its initialization and declaration with the help of an example.
A variable is a storage location in programming with a specific data type that holds data.
Example in C:
int a; // Declaration
a = 10; // Initialization
(c) Write a C program to find the factorial of a number that is input by the user.
C Program:
#include <stdio.h>
int main() {
int n, i;
scanf("%d", &n);
if (n < 0)
else {
factorial *= i;
return 0;
representation.
Common symbols:
1. Oval: Start/End
2. Rectangle: Process
3. Parallelogram: Input/Output
4. Diamond: Decision
5. Arrow: Flow of control.
(a) Define the term array and its types with example.
C Program:
#include <stdio.h>
int main() {
scanf("%f", &amount);
} else {
finalAmount = amount;
", finalAmount);
return 0;
(d) What is a pointer? Define the use of * and & operators with an example.
Example:
int a = 10;
(b) Write a C program to insert elements into two matrices and store their sum.
C Program:
#include <stdio.h>
int main() {
");
scanf("%d", &mat1[i][j]);
}
}
");
scanf("%d", &mat2[i][j]);
printf("Sum of matrices:
");
printf("
");
return 0;
}