1.
Define computer and its characteristics features in detail (Jan/Feb 2023)
A computer is an electronic device that processes data to perform various tasks according
to a set of instructions called a program. It is a versatile and powerful tool with a wide range
of applications in various fields.
The characteristics and features of a computer can be broadly categorized into the
following:
Speed:
Computers can execute instructions at incredibly high speeds, measured in terms of
gigahertz (GHz) or even terahertz (THz). This speed allows computers to perform complex
calculations and process large amounts of data in a short amount of time.
Accuracy:
Computers provide a high level of accuracy in performing calculations and processing data.
They are not prone to human errors, which ensures reliable and precise results.
Storage:
Computers can store vast amounts of data in various forms, including text, images, videos,
and more. This storage can be either volatile (temporary, like RAM) or non-volatile
(permanent, like hard drives or solid-state drives).
Diligence:
Computers can work for long hours without a break, maintaining consistent performance.
They do not suffer from fatigue or loss of concentration, making them highly diligent in
executing repetitive tasks.
Versatility:
Computers are versatile machines capable of performing a wide range of tasks. They can be
programmed to handle diverse applications, from simple calculations to complex
simulations, graphic design, scientific research, and more.
Automation:
Computers can automate repetitive tasks, reducing the need for human intervention in
routine operations. This automation enhances efficiency and productivity.
Multitasking:
Modern computers can handle multiple tasks simultaneously, allowing users to run several
applications concurrently. This capability is facilitated by multitasking operating systems.
Interactivity:
Computers enable user interaction through various input devices like keyboards, mice,
touchscreens, and voice recognition. This interactivity allows users to control and
communicate with the computer.
Connectivity:
Computers can be connected to networks, facilitating communication and data exchange
between devices. This connectivity is crucial for sharing information and resources.
Scalability:
Computer systems can be easily scaled by adding hardware components or upgrading
existing ones. This scalability allows for adapting to increasing computational demands.
Reliability:
Well-designed computer systems are reliable, meaning they can operate continuously for
extended periods without experiencing failures. Redundancy and error-checking
mechanisms contribute to system reliability.
Digital Processing:
Computers process data in digital form using binary code (0s and 1s). This digital processing
allows for precise representation, manipulation, and storage of information.
2. Write key characteristics features of stored program concept. (Jan/Feb 2023)
All digital computers are based on the principle of stored program concept, which was
introduced by Sir John von Neumann in the late 1940s.
The following are the key characteristic features of this concept:
• Before any data is processed, instructions are read into memory.
• Instructions are stored in the computer’s memory for execution.
• Instructions are stored in binary form (using binary numbers—only 0s and 1s).
• Processing starts with the fi rst instruction in the program, which is copied into a
control unit circuit. The control unit executes the instructions.
• Instructions written by the users are performed sequentially until there is a
break in the current flow.
• Input/Output and processing operations are performed simultaneously. While
data is being read/written, the central processing unit (CPU) executes another
program in the memory that is ready for execution.
3. Explain the Basic organization of the computer. (Jan/Feb 2023)
Or
Explain the Basic organization of a Computer model with neat diagram. (Jan/Feb 2023)
Or
Explain with neat diagram different components of Computer in Detail. (June/July
2023)
Block diagram of computer
Input: This is the process of entering data and instructions (also known as programs) in to
the computer system. The data and instructions can be entered by using different input
devices such as keyboard, mouse, scanner, and trackball.
Central Processing Unit (CPU): CPU is considered as the brain of the computer. CPU
performs all types of data processing operations. It stores data, intermediate results, and
instructions (program). It controls the operation of all parts of the computer.
CPU has the following two components:
i. ALU (Arithmetic Logic Unit)
ii. ii. Control Unit
i. Arithmetic & Logic Unit: All calculations and comparisons, based on the
instructions provided, are carried out within the ALU. It performs arithmetic
functions like addition, subtraction, multiplication, division and it also
performs Boolean operations (like AND OR NOT) on the numbers.
ii. i. Control Unit: Controlling of all operations like input, processing and output
are performed by control unit. It takes care of step by step processing of all
operations inside the computer. Control unit does not perform any
computational task.
Memory Unit: This is used for Saving data and instructions so that they are available for
processing as and when required by user. It is of two types: Primary and secondary
memory.
Output: Output is the process of giving the result of data processing to the outside world
(external to the computer system).
Control The control unit (CU) is the central nervous system of the entire computer system.
It manages and controls all the components of the computer system.
4. Discuss the broad classification of computer. (Jan/Feb 2023)
Or
Explain the classification of computers.
There are 4 types of computers.
1. Super computer
2. Mainframe computer
3. Mini computer
4. Microcomputer
1) Super computers
• Supercomputers are the fastest and the most expensive machines.
• They have high processing speed compared to other computers.
• Huge in size and has multiple powerful and fast processors.
• Uses huge amount of power and produces large amount of heat.
2) Mainframe computers
• Supports multi user, multi-programming, time sharing and works with LINUX.
• They operate at very high speed, have very large storage capacity and can handle the
workload of many users.
• Mainframes are large and powerful systems used in Database systems (online
transactions).
3) Minicomputers
• Mini computers are midrange computers and inherit the features of mainframe.
• They are small in size but are not affordable to use at home. .
4) Microcomputers
• Microcomputers are small, low-cost and single-user digital computers.
• Single user machine with the single chip of processor.
• They are also called as Personal computers (PC).
5. Explain the formatted and unformatted input and output statement in C (Jan/Feb
2023)
Or
Explain the input and output statement in C. (Jan/Feb 2023)
Or
Explain I/O statement in C with syntax and Example (June/July 2023)
Or
Explain the input and output statement using C with suitable programming example.
(Nov/Dec 2023)
printf()
printf() function can take any number of arguments. First argument must be enclosed
within the double quotes “hello” and every other argument should be separated by comma
( , ) within the double quotes.
Syntax: printf(“format string”, arg1, arg2, …..);
Simple Example of printf() Function
#include<stdio.h>
int main()
{
intnum = 450;
printf("Number is %d \n", num); // print number
return 0;
}
scanf()
The scanf() function is builtin function available in the C library. scanf() function can read
character, string, numeric & other data from keyboard in C language.
Syntax: scanf (“format string”, &arg1, &arg2, …..);
Simple Example of scanf() Function
#include<stdio.h>
int main()
{
int x;
printf("enter the number =");
scanf("%d",&x);
printf("The number is=%d",x);
return 0;
}
6. Explain the basic structure of a C Program. (Jan/Feb 2023)
Or
With suitable example – Explain Basic Structure of C Program. (Jan/Feb 2023)
Or
Explain with neat diagram the structure of C Program and Explain all components.
(June/July 2023)
Or Explain the Structure of C Program with an example. (Nov/Dec 2023)
Preprocessor Directive:
#include tells the compiler to include information about the standard input/output library.
It is also used in symbolic constant such as #define PI 3.14(value). The stdio.h (standard
input output header file) contains definition &declaration of system defined function such
as printf( ), scanf( ), pow( ) etc. Generally printf() function used to display and scanf()
function used to read value
Global Declaration:
This is the section where variable are declared globally so that it can be access by all the
functions used in the program. And it is generally declared outside the function:
main() It is the user defined function and every function has one main() function from
where actually program is started and it is encloses within the pair of curly braces.
7. List and Explain any two input-output Devices. (Jan/Feb 2023)
Or
Input Devices:
Keyboard:
A keyboard is a common input device that allows users to input text and commands into
the computer. It consists of keys representing letters, numbers, symbols, and functions.
Mouse:
The mouse is a pointing device that enables users to interact with graphical user
interfaces. It typically has buttons for clicking and a scroll wheel for navigation.
Touchscreen:
Touchscreens allow users to input commands and manipulate objects directly by
touching the display. They are commonly used in smartphones, tablets, and interactive
kiosks.
Trackpad:
Trackpads are touch-sensitive surfaces often found on laptops. They serve as a
substitute for a mouse, allowing users to control the cursor with finger movements.
Scanner:
Scanners are devices that convert physical documents or images into digital format.
They are used to create electronic copies of printed material.
Output Devices:
Monitor/Display:
Monitors or displays present visual information to the user. They come in various types,
such as LCD, LED, and OLED, and provide a visual interface for the computer.
Printer:
Printers produce hard copies of digital documents or images on paper. Common types
include inkjet, laser, and dot matrix printers.
Speaker:
Speakers output audio signals, allowing users to hear sounds, music, and other auditory
information generated by the computer.
Headphones:
Headphones provide a private audio output for the user. They are commonly used for
listening to music, watching videos, or participating in online meetings.
Projector:
Projectors display visual content on a larger screen or surface. They are often used for
presentations, home theater systems, or educational purposes.
Or
What are input and Output Devices? Mention various input and output Devices.
Explain keyboard and pointing input devices. (Nov/Dec 2023)
An input device is a peripheral or hardware component that allows users to input data
or commands into a computer.
An output device is a peripheral or hardware component that presents information
processed by a computer to the user in a human-readable form.
Keyboard:
Description: The keyboard is a primary input device that consists of keys, each
representing a specific character, number, or function. Users press keys to input data,
commands, or text into the computer.
Use: Commonly used for typing, text entry, and executing commands.
Mouse:
Description: A mouse is a pointing device with buttons and often a scroll wheel. It is
used to move a cursor on the screen, select items, and interact with graphical user
interfaces.
Use: Pointing, clicking, dragging, and dropping to navigate and control the computer.
Touchpad:
Description: Typically found on laptops, a touchpad is a flat surface that responds to
finger movements. It serves as a substitute for a mouse and allows users to control the
cursor.
Use: Gesture-based control, pointing, and clicking.
8. What are the basic datatypes available in C. (Jan/Feb 2023)
1. Integer(int):Integers are whole numbers that can have both zero, positive and negative
values but no decimal values. For example:10,0, -5
int id; Here, id is a variable of type integer.
2. float and double :float and double are used to hold real numbers.
float salary;
double price;
In C, floating-point numbers can also be represented in exponential. For example,
float normalization Factor = 22.442e2;
3. character: Keyword char is used for declaring character type variables. For example,
char test = 'h';
The size of the character variable is 1 byte
4. void: void is an incomplete type. It means "nothing" or "no type". You can think of void
as absent.
5. For example, if a function is not returning anything, its return type should be void.
9. Define Variable. List and explain with example the rules for declaring Variables.
(Jan/Feb 2023), (June/July 2023)
A variable is a name given to a memory location within the computer that can hold one
value at a time.
Rules for defining variables (or Identifiers)
The first character in the variable should be a letter (A to Z or a to z) or an underscore.
Example : principle_amount , Sum
The first character can be followed by any number of letters or digits (0 to 9) or
underscores.
Example : principle_amount , Sum1
No extra symbols are allowed other than letters, digits and underscore.
Example : principle amount
The length of an identifier (variables/constants) can be up to maximum of 31 characters.
C keywords should not be used as variable names.
Example: for (Invalid)
The variable name should not begin with a digit or any other special characters other
then underscore.
Example: 3_factorial (Invalid)
10. Define Constants and explain different types of Constants in C. (June/July 2023)
Constant is any value that cannot be changed during program execution.
Types of Constants in C
The type of the constant is the same as the data type of the variables.
1. Numeric constant: Numeric constant consists of digits. It required minimum size of 2
bytes and max 4 bytes. It may be positive or negative but by default sign is always positive.
It is categorized as integer constant and real constant.
Integer constants are whole number which has no decimal point. Types of integer constants
are: Decimal constant: 0-------9(base 10)
Octal constant: 0-------7(base 8)
Hexa decimal constant: 0----9, A------F(base 16)
Real constant is also called floating point constant. To construct real constant we must
follow the rule of , -real constant must have at least one digit.It must have a decimal point.
Ex.: +325.34 426.0 -32.76
2. Character constant
Character constant represented as a single character enclosed within a single quote. These
can be single digit, single special symbol or white spaces such as ‘9’,’c’,’$’, ‘ ’ etc. Every
character constant has a unique integer like value in machine’s character code as if machine
using ASCII (American standard code for information interchange). Some numeric value
associated with each upper and lower case alphabets and decimal integers are as:
A------------ Z ASCII value (65-90)
a-------------z ASCII value (97-122)
0-------------9 ASCII value (48-59)
; ASCII value (59)
11. How the C program can be compiled and executed. Explain with flow diagram all the
steps. (June/July 2023)
Preprocessor
The source code is the code which is written in a text editor and the source code file is
given an extension ".c". This source code is first passed to the preprocessor, and then the
preprocessor expands this code. After expanding the code, the expanded code is passed to
the compiler.
Compiler
The code which is expanded by the preprocessor is passed to the compiler. The compiler
converts this code into assembly code. Or we can say that the C compiler converts the pre-
processed code into assembly code.
Assembler
The assembly code is converted into object code by using an assembler. The name of the
object file generated by the assembler is the same as the source file. The extension of the
object file in DOS is '.obj,' and in UNIX, the extension is 'o'. If the name of the source file is
'hello.c', then the name of the object file would be 'hello.obj'.
Linker
Mainly, all the programs written in C use library functions. These library functions are pre-
compiled, and the object code of these library files is stored with '.lib' (or '.a') extension.
The main working of the linker is to combine the object code of library files with the object
code of our program. Sometimes the situation arises when our program refers to the
functions defined in other files; then linker plays a very important role in this. It links the
object code of these files to our program. Therefore, we conclude that the job of the linker
is to link the object code of our program with the object code of the library files and other
files. The output of the linker is the executable file.
12. Explain Algorithms, Flowcharts and Pseudo codes with example.
Algorithms:A procedure for solving a mathematical problem in a finite number of steps
that frequently involves recursive operations.
Example:
Algorithm for the addition of array elements
Start
Step 1: initialize sum =0
Step 2: iterate loop from 0 to 9 and increment by 1
Step 3:add sum with each increment
Step 4: print sum
Stop
Flowchart:Flowchart is a graphical representation of an algorithm. Programmers often
use it as a program-planning tool to solve a problem.
Example:
Add two numbers entered by the user.
A Pseudo code: is defined as a step-by-step description of an algorithm. Pseudo code
does not use any programming language in its representation instead it uses the simple
English language text as it is intended for human understanding rather than machine
reading.
Example:
IF “1”
print response
“I AM CASE 1”
IF “2”
print response
“I AM CASE 2”
13. Explain the different files used in C programming
Or
Explain the four kinds of files used in C. (Nov/Dec 2023)
A C program uses four types of files as follows:
Source Code File
This file includes the source code of the program.
The extensions for these kinds of files are '.c'. It defines the main and many more
functions written in C.
Header Files
They have an extension '.h'. They contain the C function declarations and macro definitions
that are shared between various source files.
Object files
They are the files that are generated by the compiler as the source code file is
processed.
The object file is used by the linker for producing an executable file for combining the
object files together. It has a '.o' extension.
Executable file
This file is generated by the linker.
Various object files are linked by the linker for producing a binary file which will be
executed directly.
They have an '.exe' extension.
14. Design and Implementation of Efficient Programs.
Fig. Phases in Software development Life cycle.
Requirements analysis:
In this phase, the user’s expectations are gathered to understand why the program or
software has to be developed.
Design:
The requirement documented in the previous phase act as the input to the design phase. In
this phase, a plan of actions is made before the actual development process starts.
Implementation:
In this phase, the designed algorithms are converted in to program code using any of the
high level languages.
Testing:
In this phase, all the modules are tested together to ensure that the overall system works
well as a whole product.
Software deployment, training, and support:
After the code is tested and the software or the program is approved by the user’s it is then
installed or deployed in the production environment.
Maintenance:
Maintenance and enhancements are ongoing activities that are done to cope with newly
discovered problems or new requirements. Such activities may take a long time to
complete.