Escolar Documentos
Profissional Documentos
Cultura Documentos
UNIT-I
1. Define computer.
A computer is an electronic device that manipulates information, or data. It has the ability to store,
retrieve, and process data.
2. What are the characteristics of computer?
Speed
Accuracy
Storage
Versatility
Diligence
No thoughts
3. List some important hardware and software technologies of fifth generation computers.
Artificial intelligence
Natural language processing
Parallel Processing
Superconductor technology
4. What is super computer? Give an example.
A supercomputer is a computer with great speed and memory.
Supercomputers are very expensive and are employed for specialized applications that require
immense amounts of mathematical calculations.
This kind of computer can do jobs faster than any other computer of its generation.
They are usually thousands of times faster than ordinary personal computers made at that time.
5. What are the applications of computers?
(i) Business (ii) Banking (iii) Insurance
(iv) Education (v) Marketing (vi) Health Care
(vii) Engineering Design (viii) Military (ix) Communication
(x) Government
6. What are the input and output devices?
Input devices
This unit contains devices with the help of which we enter data into computer. This unit makes link
between user and computer.
Keyboard Mouse Joy Stick
Light pen Track Ball Scanner
Graphic Tablet Microphone
Output devices
Output unit consists of devices with the help of which we get the information from computer. This
unit is a link between computer and users. Output devices translate the computer's output into the
form understandable by users. Following are few of the important output devices which are used in a
computer.
Monitors
Graphic Plotter
Printer
7. What is 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 computer. CPU itself has following three components
ALU(Arithmetic Logic Unit)
Memory Unit
Control Unit
1
8. Define flow chart. Why is flow chart required?
A flowchart is a type of diagram that represents an algorithm, workflow or process, showing the
steps as boxes of various kinds, and their order by connecting them with arrows. This diagrammatic
representation illustrates a solution model to a given problem.
9. Define pseudo code.
Pseudo code is an informal high-level description of the operating principle of a computer program
or other algorithm. It uses the structural conventions of a programming language, but is intended for
human reading rather than machine reading.
10. What is an algorithm?
An algorithm is a step-by-step procedure to solve a given problem. An algorithm is a representation
of a solution to a problem.
UNIT-II
1. What are the features of C?
Well suited for structured modular programming.
Robust language with rich set of built-in functions and operators.
Has minimal instruction set and programs written in are efficient and fast.
Highly portable.
Highly flexible.
Allows access to the machine at bit level (Low level (Bitwise) programming).
2. Draw the structure of C program.
A C program basically has the following form:
Documentation Section 3.
Link Section
Definition Section
Global Declaration Section
main()
{
Declaration Section
Executable part
}
Subprogram section
Function 1
Function 2
..
function n
2
5. List different data types in C.
break continue
Used to terminate the loops or to exit Used to transfer the control to the start
loop from a switch. of loop.
The break statement when executed Continue statement when executed
causes immediate termination of loop causes Immediate termination of the
containing it. current iteration of the loop.
UNIT-III
1. Define array. What are its types?
C programming language provides a data structure called the array, which can store a fixed-size
sequential collection of elements of the same type. An array is used to store a collection of data, but it
is often more useful to think of an array as a collection of variables of the same type.
Types are:
o One-dimensional arrays
o Multidimensional arrays
2. What are the advantages of array?
It is used to represent multiple data items of same type by using only single name.
It can be used to implement other data structures like linked lists, stacks, queues, trees,
graphs etc.
2D arrays are used to represent matrices.
3. How to declare and initialize one dimensional and two dimensional array? Give an example.
(i) One-dimensional array:
Declaration:
data_type array_name[array_size];
Example:
int age[5];
4
Initialization:
int age[5]={2,4,34,3,4};
(ii) Multidimensional Array:
Declaration:
data_type array_name[array_size][array_size];
Example:
int c[5][4];
Initialization:
int c[2][3]={{1,3,0}, {-1,5,9}};
4. Define string. List any four string handling functions.
Strings are sequence of characters enclosed within double quotes. Every string constant is
automatically terminated with a special character ‘\0′ called the null character which represents the
end of the string.
Example:
“hello”, “abc”, “hello911″
String Functions:
Function Work of Function
strlen() Calculates the length of string
strcpy() Copies a string to another string
strcat() Concatenates(joins) two strings
strcmp() Compares two string
strlwr() Converts string to lowercase
strupr() Converts string to uppercase
strrev() Reverse the string
UNIT-IV
1. Define function. What is the need for function?
Functions are smaller self-contained components which carry out some specific, well defined task.
The benefits are:
It facilitates top-down modular programming
It avoids the need for redundant code
It facilitates reusability
It can be used to build a customized library of frequently used routines
2. What is function prototype?
Declaration of a function is called function Prototype. Prototype specifies the signature of the
function, the return type and number and data types of the arguments. Functions must be declared
5
before it is called. In C, prototyping is not mandatory; it is needed if a function call precedes function
definition.
Syntax
return_type function_name (function arguments);
3. Define Recursion.
A function which call by itself is called recursion. A recursive function must have the following
properties:
The problem must be written in a recursive form.
There must be a base criteria (terminating condition) for which the function doesn’t call itself.
4. What is the difference between call by value and call by reference?
UNIT-V
1. Define structure.
The structure is a derived data type used to represent heterogeneous data.
A structure is an aggregation of components that can be treated as a single variable. The
components are called members.
Example:
struct employee
{
int code;
6
char name[20];
int dept_code;
float salary;
};
struct employee emp1;
2. What is the purpose of union in C?
A union is a special data type available in C that enables you to store different data types in the same
memory location.
Example:
union employee
{
int code;
char name[20];
int dept_code;
float salary;
};
union employee emp1;
3. Differentiate structures and unions.
Structure Union
It allocates memory equal to sum of memory It allocates piece of memory that is Large
allocated to its each individual member. enough to hold the Largest variable of type in
union
struct keyword is used union keyword is used
each member have their own memory space. one block is used by all the members of union.
structure can not be implemented in shred Union is the Best environment where memory is
memory. shared.
it has less Ambiguity. Ambiguity is more in union.
All members can be accessed at a time. only one member is accessed at a time.