Documente Academic
Documente Profesional
Documente Cultură
Accounting
9. Define Hardware and Software.
The term Hardware is applied to any physical equipment in the computer system, such as machinery.
Software is basically the set of instructions grouped into programs that make the computer to function in the
desired way. It is a collection of programs to perform a particular task.
10. Give the basic computer functional units?
Input Unit
Central Processing Unit
Output Unit
11. Define types of programming languages.
Machine Language: It uses only 0s and 1s to represent data and the instructions.
Assembly Language: It uses only mnemonic codes to represent data and the information.
High-Level Language: These Languages are written using a set of words and symbols by accessing specific
rules and syntax.
12. List out the operations performed by the central processing unit.
It performs all calculations and all decisions.
It controls and co-ordinates all units of the computer.
It interprets instructions of a program.
It stores data temporarily and monitors external request.
13. Define operating system.
A collection of programs used to control and co-ordinate the computer system is called operating system. Operating
system manages and coordinates the functions performed by the computer system hardware, I/O devices, including the CPU,
secondary storage devices, communication and network equipment.
14. Define bits & bytes?
Bits: Bits is known as binary digit. Each bit value can be 0 or 1
Byte :Bytes are most commonly made up of eight bits used to store a single character.
15. Define RAM.
Random Access Memory (RAM) is a temporary memory where the computer stores all the data it receives from input
and the results it gets through calculations.
16. Define ROM.
Read Only Memory (ROM) is permanently in-built in the computer at the time of production. It stores a set of
instructions permanently which instructs the computer how to work.
17. What are the types of ROM?
PROM Programmable ROM
EPROM Erasable PROM
Dynamic RAM
It has short data life.
Need to be refreshed to maintain data in it.
More number of chips used.
Slow compared to Static RAM.
ROM
It is a non-volatile memory
The content are permanent
Available in high storage capacity
Processor speed is low
Cost effective
RAM
It is a volatile memory
The content are temporary
Available in small storage capacity
Processor speed is high
Cost is very high
An algorithm is the step by step instructions of a program. Algorithm means the logic of a program. It is a
step-by-step description of how to arrive at a solution of a given problem.
25. Define flowchart.
It is a pictorial representation of an algorithm. It contains some standard symbols. The steps are drawn by
using different shapes and the flow is indicated by arrows.
26. What is Pseudocode?
Pseudo means imitation of false and code refers to the instruction written in the programming
language. Pseudo code is programming analysis tool that is used for planning program logic.
NUMBER SYSTEM
FLOW CHARTS
UNIT 2
1.Define Problem formulation.
Problem formulation is a plan for collecting requirements and utilizing data about a problem.
It helps to obtain the desired information about the problem.
2.Define Problem solving.
It is the process of transforming the description of a problem into a solution by using our knowledge of the problem
domain by using appropriate techniques and tools.
3.What is documentation?
It provides a written description of each step of the program.
It allows the user to operate the program correctly.
4. Give any four features of C language?
Low level language support.
Structured programming.
Program portability.
Logical AND only used in conjunction with two expressions to test more than one condition. If both the
condition are true then returns one, if false then return zero. Bit wise AND only used in bit wise manipulation. It is
an unary operator.
26. Define expression
An expression is a combination of variables, constants and operators.
An expression is evaluated using assignment operator.
Example: x = a*b c ;
27. What are types of I/O statements available in C?
Formatted functions
printf( ), scanf( )
Unformatted functions
input/output functions
28. What are the differences between while and dowhile loop?
While
Do while
The break statement is used to terminate the loop when the keyword break is used inside any c loop control
automatically transferred to the first statement after the loop. Break is usually associated with an if statement.
31. Define goto statement?
The goto statement transfer control unconditionally from one place to another place in the program.
32. What is meant by continue statement?
When continue statement is encountered inside a loop, control automatically passes to the beginning of the loop.
Operands
Operands are data values.
is Operands are the variables on which the
operation is performed.
35. Write the syntax of for loop in C. Write a for loop statement to print numbers from 10 to 1.
For(initialize counter; test condition;increment/decrement)
{
Statements;
}
36. Write a program to accept an input from user and prints it.
#include<stdio.h>
#include<conio.h>
void main( )
{
int a;
printf(enter an integer);
scanf(%d,&a);
printf(The value is %d, a);
getch();
}
PROGRAMS
For(int i=10;i>=1;i--)
{
Printf(%d,i);
}
Unit III
1. Define array?
Syntax:
10
The array which is used to represent and store data in a single dimension is called one dimensional array.
Declaration of One dimensional array
The array which is used to represent and store data in two dimensions called two dimensional array.
Declaration of Two dimensional array
11
Static Array
If the range of an array is included in the
Dynamic Array
If the range of an array is not included in the
- It is the process of defining the string variable, the size of the string and its type.
It is a formatted
2. gets ( )
It is an unformatted
3. getchar ( )
It is an unformatted
input function to read a single input function to read a group input function to read a single
character or word from the input of characters until an enter key character at a time.
12
Syntax:
Syntax:
gets(variable-name);
variable-name = getchar( );
2. puts ( )
It is a formatted
3. putchar ( )
It is an unformatted
It is an unformatted
output function to write a single input function to read a group input function to read a single
character or word to the output of characters until an enter key character at a time.
device and the format of the is pressed.
string is %s .
Syntax:
Syntax:
Syntax:
puts(variable-name);
variable-name = putchar( );
13
linear search.
binary search.
else
puts("The Given String is Not Palindrome\n");
getch( );
}
Unit 4
1. What is Function?
A set of instructions to perform specific tasks that occur several times in the main program is called a function.
Functions are the building blocks in a program. Functions are also called as subprograms.
2. What are the types of function?
1.Predefined functions
Predefined functions are created by the person who designed and created C compiler. These are also called as
library functions. Example: log(x), sin(x) etc.
2.User defined functions
User defined functions are created by user according to their requirements. They are used to perform a
particular task. They can be given after or before the main function.
3. How to define a Function?
Syntax:
return_type
function_name (parameter_list)
// function header
{
local declaration;
executable statements;
// function body
return;
}
4. List out the function prototypes?
Function without arguments and without return values.
Function with arguments and without return values.
Function with arguments and with return values.
Function without arguments and with return values.
5. What are the three elements of user defined function?
Function definition
Function declaration
Function call
6. What is a parameter? What are the types of parameters?
Parameters serve as input data to the function to carry out the specified task.
Parameters are classified into two types. 1. Formal Parameters 2. Actual Parameters.
7. What is a meant by actual parameter and formal parameter?
15
The formal parameters allow information to be transferred from the calling program. The parameters used in the
function definition.
The actual parameters are the arguments in the calling function. The parameters used in the function call.
Pass by reference
The values are directly passed to a function. It is The address of a variable is passed to a function. It
also called call by value.
New local memories are allocated for formal New local memories are not allocated for formal
parameters and the values of actual parameters parameters and the values of actual parameters are
are copied into the formal parameters.
function( )
{
function( );
}
Advantages
It is useful for branching processes.
It is written with less number of statements.
Recursive functions are effective.
Disadvantages
It is difficult to think the logic of a recursive function.
It is also difficult to debug the same.
16
data-type *variable-name;
If the pointer does not have exact address to be assigned when the NULL value is assigned.
A pointer that is assigned NULL is called a null pointer.
15. Define arrays of pointer?
A structure is a collection of variable under a single name. Structure is a user defined data type.
The keyword struct declares a structure to hold the details of data fields. These fields are called structure members.
2. What is the need for structure datatype?
Each element in an array must be of the same data type. All the data type can't be expressed in a single array. We
have to declare different arrays for each data type. But there will be a big increase in source code. Hence arrays cannot be
useful here. It is often desirable to group data of different types and work with that grouped data as one entity. The power to
accomplish this grouping with a new data type is called a structure.
3. Define structure declaration. Or How to declare a structure?
A structure variable declaration is similar to declaration of variables of any other data types. The list of fields used to
declare structure variables are:
1. Keyword struct
2. Structure name
17
3. A terminating semicolon
4. List of variable names seperated by commas.
4. What are the rules to declare a structure?
Rule-1: A structure must end with semicolon.
Rule-2: Each structure element must be terminated.
Rule-3: Usually, a structure appears at the top of the source program.
Rule-4: The structure element must be accessed by structure variable with dot(.) operator.
5. Give the syntax for structure declaration.
Syntax
Example
struct structure-name
struct book
{
char title[50];
char author[50];
char subject[50];
int book-id;
} book1,book2;
{
struct_element 1;
struct_element 2;
struct_element n;
}one or more structure variables;
6.How structure elements can be accessed ?
The process of using the structure members by its corresponding structure variable in a C program is called accessing
structure member. To access any member of a structure, we use the member access operator (.)
Syntax
structure-name . structure-member ;
Structure
A structure is a collection of heterogeneous data
type in a sequence.
Array
An array is a collection of homogeneous data type.
structure variables.
8. Define Union?
position.
18
Example
union union-name
union book
{
char title[50];
char author[50];
char subject[50];
int book-id;
} book1,book2;
{
union_element 1;
union_element 2;
union_element n;
} one or more union variables;
11. What are the rules to declare a union?
The following rules should be followed while declaring a union.
Rule-1: A union must end with semicolon.
Rule-2: Each union element must be terminated.
union-name . union-member ;
STRUCTURE
The keyword struct is used to define a structure.
When a variable is associated with a union, the compiler When a variable is associated with a structure, the compiler
19
allocates the memory by considering the size of the largest allocates the memory for each member. The size of structure
memory. So, size of union is equal to the size of largest is greater or equal to the sum of sizes of its members. The
member.
Memory allocated is shared by individual members of union. Each member within a structure is assigned unique storage
area of location.
15. Define nested structure?
If a structure contain more than one structure as its members is known as nested structure.
Example
struct date
{
int date,month,year;
}dob;
struct student
{
char name[10];
struct date dob;
}student1;
16.What are storage classes?
Storage classes tell the compiler where to store a variable, how to store a variable, what is the initial value of the
variable and life time of the variable.
Syntax
20
Example:
# define,
# include
21