Sunday, January 8, 2012

GE2112 FUNDAMENTALS OF COMPUTING AND PROGRAMMING


GE2112 FUNDAMENTALS OF COMPUTING AND
PROGRAMMING
UNIT I
INTRODUCTION TO COMPUTERS
1. Define Computer. Give its expansion.
Computer is fast operating device, which automatically accepts and store input
data, process them and produce result under the direction of step by step.
COMPUTER:  Commonly oriented machine particularly used for trade and
education research.
2. Define storing.
Storing is the process of saving or retaining the data or information or instruction,
so that the user can retain and retrieve it whenever required.
3. Define Data and Information.
Data: It is nothing but the fact or raw material for the information processing.
Information: The processed data is called information.
4. Give the basic computer functional units?
 Input Unit
 Central Processing Unit
 Output Unit
5.What are characteristics of computers?
The characteristic of the computers are speed, accuracy, automation, endurance,
storage, versatility, cost reduction, no intelligent quotient(IQ).
5. List out the operations performed by the central processing unit.
 It performs all calculation and all decisions.
 It controls and co-ordinates all unit of the computer.
 It interprets instruction of a program.
 It stores data temporarily and monitors external request.
6. Define Hardware.
The term Hardware is applied to any physical equipment in the computer system,
such as machinery.CSE-WEB-PORTAL facebook
2
7. Define software.(R)
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”.
8. 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.
9. Basic Operations of a computer
The computer have the following five basic operations to carry out any task.
They are
1.Input
2.Process
3.Output
4.Storing
5.Controlling
10.Define type of RAM
 Masked ROMS
 PROM
 EPROM
 EEPROMS
 Flash ROMS.
11. Differentiate between static and dynamic RAM .
S.No Static RAM Dynamic RAM
1. Retain its content as long as power
is available.
Its has short data life.
2. Constantly maintained data. Need to be refreshed to maintain
data in it.
3. Less number of chip used. More number of chips used.
4. Very fast. Slow compared to Static RAM.
12. Differentiate between RAM and ROM.
S.No ROM RAM
1. It is a non-volatile memory It is a volatile memory
2. The content are permanent The content are temporary
3. Available in high storage capacity Available in small storage capacityCSE-WEB-PORTAL facebook
3
4. Processor speed is low Processor speed is high
5. Cost effective Cost is very high
6. Generally the operating system
supporting programs can be stored
User defined program can be
stored at any time
13. Define cache memory?
A small memory between CPU and main memory is called cache memory. The
access time is closer to the processing speed of the CPU. Cache memory acts as a high
speed buffer between CPU and main memory. It is used to temporarily store active data
and instructions during processing.
14. Specify the advantages of magnetic tape?
 Non-volatile memory
 Voluminous data can be stored
 These tapes are easily transportable, they are compact in size, light weight, easily
removable and easy to handle.
15. List out the cables used to connecting computers with peripherals?
 Power cord
 Monitor cable
 Mouse cable
 Keyboard cable
 Printer cable
UNIT II
COMPUTER SOFTWARE
1. List out some application software?
 Adobe Photoshop
 Adobe PageMaker
 Word processing
 Spreadsheet package
 Presentation package
2. What is meant by software piracy?
Software piracy is a illegal distribution and/or reproductions of any software
applications or fonts for business or personal use.
3. Define electronic mail?
Electronic mail is one of the most popular uses of the internet once you have an
email account you can send an electronic message to just about anyone else with an email
account so as long as you know their email address.CSE-WEB-PORTAL facebook
4
4 Define Software Categories?.
Software divided into two categories:
 systems software : Includes the operating system and all the utilities that
enable the computer to function.
 applications software : Includes programs that do real work for users. For
example, word processors, spreadsheets, and database management systems fall
under the category of applications software.
5. What you mean System Software?
System Software: It helps in running the computer hardware and the computer
system. System software is a collection of operating systems; devise drivers, servers,
windowing systems and utilities. System software helps an application programmer in
abstracting away from hardware, memory and other internal complexities of a computer.
6. What you mean Application Software?
Application Software: It enables the end users to accomplish certain specific
tasks. Business software, databases and educational software are some forms of
application software. Different word processors, which are dedicated for specialized tasks
to be performed by the user, are other examples of application software.
7 .Use of System Software?
System software helps run the computer hardware and computer system. It includes:
 device drivers,
 operating systems,
 servers,
 utilities,
 windowing systems,
The purpose of systems software is to unburden the applications programmer
from the details of the particular computer complex being used, including such accessory
devices as communications, printers, readers, displays, keyboards, etc. And also to
partition the computer's resources such as memory and processor time in a safe and stable
manner.
8. Define Programming software
Programming software usually provides tools to assist a programmer in writing
computer programs, and software using different programming languages in a more
convenient way. The tools include:
 compilers,
 debuggers,CSE-WEB-PORTAL facebook
5
 interpreters,
 linkers,
 text editors,
9. Need for Application software
Application software allows end users to accomplish one or more specific (not directly
computer development related) tasks. Typical applications include:
 industrial automation,
 business software,
 computer games,
 telecommunications, (i.e. the internet and everything that flows on it)
 databases,
 educational software,
 medical software,
10 Define Phases of Software Development Steps?
i. Requirement Analysis
ii. Design
iii. Development
iv. Testing
v. Implementation and Maintenance
11. Define WWW?
The World Wide Web is a collection of interconnected documents
and other resources, linked by hyperlinks and URLs. The WWW is merely a service
accessible via internet, along with many other services including e mail .file sharing etc..
12. Define Web page?
A web page or webpage is a resource of information that is suitable for the World
Wide Web and can be accessed through a web browser. This information is usually in
HTML or XHTML format, and may provide navigation to other web pages via hypertext
links.
13. Define Web Browser?
A web browser is a software application which enables a user to display
and interact with text, images, videos, music, games and other information typically
located on a Web page at a website on the World Wide Web or a local area network. ...CSE-WEB-PORTAL facebook
6
14. Define IP
DEFINITION: The Internet Protocol (IP) is the method or protocol by which
data is sent from one computer to another on the Internet. Each computer (known as a
host) on the Internet has at least one IP address that uniquely identifies it from all other
computers on the Internet. When you send or receive data (for example, an e-mail note or
a Web page), the message gets divided into little chunks called packets. …
Definition continues below.
15. Define URL?
The unique address of any Web document. The URL tells the browser where a
file is and how to deal with it. The URL is like a path leading to a particular file on a
particular website on a particular server. On your screen, the URL is displayed near the
top of a webpage in the address bar.
16. Define Domain name system?
Definition: The DNS translates Internet domain and host names to IP addresses. DNS
automatically converts the names we type in our Web browser address bar to the IP
addresses of Web servers hosting those sites.
DNS implements a distributed database to store this name and address information for all
public hosts on the Internet. DNS assumes IP addresses do not change (are statically
assigned rather than dynamically assigned).
17 Define TELNET?
 Telnet (Telecommunication network) is a network protocol used on the
Internet or local area network (LAN) connections. ...
 A network protocol that enables one computer to communicate with
another via the Internet; the program that acts as the client in this situation
...
 An Internet protocol that allows the user to connect to a remote computer.
 The Internet standard protocol for remote login (terminal connection)
service. TELNET allows a user at one site to interact with a remote ...CSE-WEB-PORTAL facebook
7
UNIT III
PROBLEM SOLVING AND OFFICE AUTOMATION
1. What is Algorithm?
Algorithm means the logic of program. It is a step-by-step description of how to
arrive at a solution of a given problem
2. Define flowchart.
Flowchart is a pictorial representation of an algorithm, it is the layout and visual
representation of the plan to be followed by the corresponding algorithm.
3. What is a decision table?
A Decision table is a table containing the selection of conditions to be tested and
how those conditions should be nested to arrive at the proper action.
4. What is Pseudocode?
“Pseudo” means imitation of false and “code” refers to the instruction written in a
programming language. Pseudocode is programming analysis tool that is used for
planning program logic.
5. 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.
6. Define compiler.
It is a program, which is used to convert the high-level language programs into
machine language.
7. Define Assembler.
It is a program, which is used to convert the assembly level language programs
into machine language.
8. Define Interpreters.
It is a program, it takes one statement of high-level language program, translates it
into machine language instruction and the immediately executes the resulting machine
language instruction and so on.
9. Diffrentate between Compiler and Interpreters.
S.No Compiler Interpreters
1. A compiler is used to compiler an
entire program and an executable
program is generated through the
An interpreter is used to translate
each line of the program code
immediately as it is entered.CSE-WEB-PORTAL facebook
8
object program.
2. The executable program is stored
in a disk for future use or to run it
in another computer.
The executable program is generated
in RAM and the interpreter is
required for each run of the
program.
3. Most of the languages use
compiler
A very few languages use
interpreters
10 Define office automation?
Application of information technology to the typical clerical and secretarial tasks
such as communication, correspondence, documenting, and filing.
11. What is office automation?
The term office automation refers to all tools and methods that are applied to office
activities which make it possible to process written, visual, and sound data in a computeraided manner.
Office automation is intended to provide elements which make it possible to
simplify, improve, and automate the organisation of the activities of a company or a
group of people (management of administrative data, synchronisation of meetings, etc.).
Considering that company organizations requires increased communication, today, office
automation is no longer limited to simply capturing handwritten notes. In particular, it
also includes the following activities:
1. Exchange of information
2 Management of administrative documents
3. Handling of numerical data
4. Meeting planning and management of work schedules
12. Define Program
A Program is a set of instructions written to carryout a particular task
13. Define the waterfall method
The basis for most systems analysis and design methodologies is the system
development life cycle or SDLC). It is sometimes called the waterfall method because the
model visually suggests work cascading from step to step like a series of waterfalls.CSE-WEB-PORTAL facebook
9
Key terms
Analysis —
To attack a problem by breaking it into sub-problems. The second step in the
system development life cycle (following problem definition) during which the
responsible people determine exactly what must be done to solve the problem.
Boundary —
An entity that serves to delimit or separate a system from its environment.
Control —
An expected value that can be compared with feedback. If the feedback suggests a
deviation from the expected value (the control), the system reacts by attempting to
adjust itself.
Design —
The third step in the system development life cycle (following analysis and
preceding development) during which the responsible people determine how the
problem will be solved by specifying the system’s physical components.
Development —
The fourth step in the system development life cycle (following design and
preceding testing) during which the system is created.
Feedback —
The return of a portion of the system’s output to its input.
Implementation —
The sixth step in the system development life cycle (following testing and
preceding maintenance) during which the system is installed and released to the
user.
Information system —
A set of hardware, software, data, human, and procedural components intended to
provide the right data and information to the right person at the right time.
Interface —
A mechanism or point of interaction between two or more system components.
Maintenance —
The final step in the system development life cycle (following implementation)
intended to keep the system functioning at an acceptable level.
Methodology —
A body of practices, procedures, and rules used by those who work in a discipline
or engage in an inquiry. Often implemented as a set of well-defined steps or
phases, each of which ends with a clear, measurable set of exit criteria.
Problem definition —CSE-WEB-PORTAL facebook
10
The first step in the system development life cycle during which the problem is
identified, its cause determined, and a strategy for solving it developed.
Process —
An activity that changes a system in some way.
Suprasystem —
A system’s environment.
System —
A set of interrelated components that function together in a meaningful way.
System development life cycle (SDLC) —
A set of steps for solving information system problems; the basis for most
systems analysis and design methodologies.
System life cycle —
A model that stresses the stages of system usefulness. The stages are birth,
development, growth, maturity, and death.
Testing —
The fifth step in the system development life cycle (following development and
preceding implementation) intended to ensure that the system does what it was
designed to do.
UNIT IV
INTRODUCTION TO C
1. Who developed C language?
C is one of the most popular programming languages. It was developed by Dennis
Richie at Bell Laboratory at USA in 1972.
2. Give any four features of C language?
1. C is a general purpose structured programming language.
2. C is powerful, efficient, compact and flexible.
3. C is highly portable.
4. C is a robust language whose rich set of built in functions and operators
can be used to write any complex program.
3. What is meant by global declaration section?
The variables that are used in more than one function throughout the program are
called global variables and declared outside of  all the function that is before main().CSE-WEB-PORTAL facebook
11
4. Define commands?
Commands are very helpful in identifying the program features and under laying
logic of the program. This line begins with /* and ends with / are known as command
lines. These are not executable the complier is ignored anything in between /*and */.
5. What are programming rules should follow while writing the C program?
1. All statements in C program should be written in lowercase letters.
Uppercase letters are only used for symbolic constants.
2. Blank spaces may be inserted between the words. It is not used while
declaring a variable, keyword, constant and function.
3. The program statement can write any where between the two braces
following the declaration part
4. The user can also write one or more statements in one line separating them
with a semicolon.
6. Define logical and data errors?
Logical error: These are the errors in which conditional and control statements
cannot end there match after some sequential execution.
Data errors:  These are the errors in which the input data given is not in proper
syntax as specified in input statements.
7. List out the characteristic of a program?
 Clarity
 Integrity
 Simplicity
 Efficiency
 Generality
8. What is meant by C character set?
The character set is a fundamental raw material of any language and they are used
to represent information like natural languages, computer language will also have well
defined character set, which is used to built the programs.
9. What is meant C tokens?
The programs are usually referred as individual text and punctuation in a passage
of text. The C language program can contain the individual units called C tokens
10. Define identifiers?
Identifiers are names given to various program elements such as variable,
functions and arrays etc.
11. Define data types?
Data type is the type of the data that are going to access within the program. C
supports different data types each data type may have pre-defined memory requirement
and storage representation.CSE-WEB-PORTAL facebook
12
12. What are different data types available in C?
 int
 float
 character and
 double.
13. What are keywords?
Keywords are certain reserved words that have standard and pre-defined meaning
in C. These keywords can be used only for their intended purpose.
14. What is meant by variables?
A variable is an identifier that is used to represent some specified type of
information within a designated portion of the program.
15. What is meant by local variables?
A variable which are defined inside a function block or inside a compound
statement of a function subprogram are called local variables.
16. Define constants?
The items whose value cannot be changed during a execution of a program are
called constants.
17. What are the types of numeric constants?
 Integer constant: Integer constant formed with the sequence of digits. There are
three type of integer constants which forms different number system
 Real constant: Real constant is made up of a sequence of numeric digits with
presence of decimal point. It serves as a good purpose to represent quantities that
vary continuously such as distance, height, temperature etc.
18. Define statements?
Statements can be defined as set of declaration or sequence of action. Statement
causes the computer to perform some action.
19. What is a operator and an operand?
An operator is a symbol that specifies an operations to be performed on operands.
e.g. +, -, *, / are called arithmetic operators.
The data items that operators act upon are called operands.
e.g. a+b. In this a and b are called operands.
20. Difference string constant.
A string constant is a sequence of characters enclosed in a double quotes, the
characters may be letters , numbers , special characters and blank space etc, at the end of
the string ‘ \0 ‘ is automatically placed.
21. What are the types of operators?
 Arithmetic operators
 Relational operators
 Logical operatorsCSE-WEB-PORTAL facebook
13
 Assignment operators
 Increment and decrement operators
 Conditional operators ( Ternary operator )
 Bit wise operators
 Special operators
22. What is ternary operator?
Ternary operator is a conditional operator with symbol ?  and :
Syntax: variable = exp1? exp2: exp3
If the exp1 is true variable takes the value of exp2. If the exp1 is false variable
takes the value of exp3.
23.  What are the bit wise operators available in c?
& - Bit wise AND
| - Bit wise OR
~ - One’s complement
>> - Right shift
<< - Left shift
^ - Bit wise XOR   are called bit field operators.
24.  What is the logical operator available in c?
The logical operators in C are
&& - Logical AND
| | - Logical OR
! - Logical NOT
25. What is difference between logical AND and bit wise AND?
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.   What is difference between ‘= ‘ and ‘= = ‘operator?
Where = is an assignment operator and = = is a relational operator.
27.   Define expression
An expression represents data item such as variables, constants and are
Interconnected with operators as per the syntax of the language. An expression is
evaluated using assignment operators.
28. What are types of I/O statement available in C?
There are two types I /O statements available in C:
Formatted I/O statement
Un formatted I/O statement
29.  Define single character input getch ( ) function.CSE-WEB-PORTAL facebook
14
The  getch ( )  function is  written in standard I/O library. It reads a single
character from a standard input device. This function does not require any arguments,
through a pair of empty parenthesis, must follow the statement getch ( ).
30.  Define single character output putchar ( ) function.
The putchar ( ) function is used to display one character at a time on the
standard output device. This function does the reverse operation of a  single character
input function.
31. Define scanf ( ) statement.
The scanf ( ) function is used to read information from the standard input device
( key board ). Scanf ( ) function starts with the string argument  and may contain
additional argument.
Syntax: scanf(“control string”,&var1,&var2,…..,&varn);
32. Define printf ( ).
Output data or result of an operation can be displayed from the computer to a
standard output device using the library function printf ( ). This function is used to
output any combination of data.
Syntax: printf(“control string”,var1,var2,…..,varn);
33. What is conversion specification?
The conversion specification are used to  accept or display the data using the
INPUT / OUTPUT statements.
34. What is the difference between scanf( ) and  gets( )?
In scanf( ) when there is a blank was typed, the scanf( ) assumes that it is an
end. gets( ) assumes the enter key as end, that is gets() gets a  new line ( \ n ) terminated
string of characters from the keyboard and replaces  the ‘\n’  with ‘ \0 ‘.
DECISION   MAKING
35. Define simple if statement?
The if statement is a decision making statement. It is used to control the flow of
execution of the statements and also used to test logically whether the condition is true or
false.
Syntax: if(expression)
{
statements;
}
36. What is meant by looping?
The loop is defined as the block of statements which are repeatedly executed for
certain number of times.
37. Define if-else statement?CSE-WEB-PORTAL facebook
15
It is basically two way decision-making statement and always used in conjunction
with condition. It is used to control the flow of execution and also used to carry out the
logical test and then pick up one of the two possible actions depending on the logical test.
Syntax: if(expression)
{
statements;
else
statements;
}
38. Define for loop?
The for loop is another repetitive control structure and is used to execute set of
instructions repeatedly until the condition becomes false.
39. What are the differences between while and dowhile loop?
While                                                               dowhile
This is top tested loop                                            This is the bottom tested loop
The condition is first tested if the It executes the body once after it check
condition is true then the block is executed           the conditions if it is true the body of
until the condition becomes false.                          the loop is executed until the condition
become false.
Loop will not be executed if the condition             Loop is executed atleast once
is false.                                                                    even though the condition is false.
40. What is meant by switch statement?
The switch statement is used to pick up or execute a particular group of
statements from several available group of statements. It allows us to make a decision
from the number of choices.
41. Define nested for loop?
The loop within the loop is called nested loop. In nested for loop one or more for
statements are included in the body of the loop. The number of iterations in this type of
structures will be equal to the number of iterations in the outer loop multiplied by the
number of iterations in the inner loop.
42. What is meant by break statement?
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.
43. Define goto statement?
The goto statement transfer control unconditionally from one place to another
place in the program.
44. What is meant by continuous statement?CSE-WEB-PORTAL facebook
16
If we want to take the control to the beginning of the loop by passing the
statements inside the loop which have not yet been executed, for this purpose the
continue is used. When the statement continue is encountered inside any C loop control
automatically passes to the beginning of the loop
UNIT-V
FUNCTIONS AND POINTERS
1. What is Function?
A Function is a self-contained program segment that carries out some specific,
well-defined task. A function will process information that is passed to it from the calling
portion of the program, and return a single value. Information is passed to the function
via special identifiers called arguments (also called Parameters), and returned via the
return statement.
2. How to define a Function?
A Function definition has two principal components: the first line (including the
argument declarations), and the body of the function. The first line of a function
definition contains the type specification of the value returned by the function followed
by the function name, and (optionally) a set of arguments, separated by commas and
enclosed in parentheses. The remainder of the function definition is a compound
statement that defines the action to be taken by the function.
3. How to Access a function?
A function can be accessed (i.e., called) by specifying its name, followed by a list
of arguments enclosed in parentheses and separated by commas.
4. What is a meant by actual arguments and formal arguments?
The arguments appearing in the function call are referred to as actual arguments,
in contrast to the formal arguments that appear in the first line of the function definition.
Actual argument must be of the same data type as its corresponding formal argument.
The value of each actual argument that is transferred into the function and assigned to the
corresponding formal argument.
5. Define Call by value or Pass by value?
Value is passed to a function via an actual argument, the value of the actual
argument is copied in to the function. Therefore, the value of the corresponding formal
argument can be altered within the function, but the value of the actual argument within
the calling routine will not change. This procedure for passing the value of an argument
to a function is known as passing by value.
6. Define call by reference?
Call by reference is another way of passing parameters to the function. Here the
address of arguments are copied in to the parameters inside the function, the address is
used to access the actual arguments used in the call. Hence changes made in the
arguments are permanent.CSE-WEB-PORTAL facebook
17
7. Define recursion?
Recursion is a process by which a function calls itself repeatedly, until some
specified condition has been satisfied. The process is used for repetitive computations in
which each action is stated in terms of a previous result. Many iterative (i.e. repetitive)
problems can be written in this form.
8. What is meant by storage class?
Storage class refers to the permanence of a variable, and its scope within the
program.
9. What is meant by automatic (local) variable?
Automatic variables are always declared within a function and are local to the
function in which they are declared; that is their scope is confined to that function.
Automatic variables defined in different functions will therefore be independent of one
another even though they may have the same name.
10. What is meant by static variable?
The static variable may be an internal or external type, depending upon where it is
declared. If declared outside the function body, it will be static or global.
11. What is meant by external (global) variable?
External variable in contrast to automatic variables, are not confined to single
functions. Their scope extends from the point of definition through the remainder of the
program. Hence they usually span two or more functions, and often an entire program.
They are often referred to as global variables. External variables are recognized globally,
they can be accessed from any function that falls within their scope. They retain their
assigned values within the scope.
12. Define register variable?
Registers are special storage areas within a computers central processing unit. The
actual arithmetic and logical operation that comprise a program are carried out within
these register.
13. What is meant by library functions?
C language provides built in functions or intrinsic functions called Library
Functions. The complier itself evaluates these functions.
14. List some library functions?
 sqrt(x)
 log(x)
 abs(x)
 fabs(x)
 exp(x)
 pow(x,y)CSE-WEB-PORTAL facebook
18
ARRAYS
15. Define array?
An array is a group of related data items that share a common name. While the
complete set of values is referred to as an array, the individual values are called elements.
16. Write the classification of array?
Arrays can be classified into
 One-dimensional arrays
 Two-dimensional arrays
 Three-dimensional arrays
17. Define One-dimensional arrays?
A list of items can be given one variable name using only one subscript and such
a variable is called a single-subscripted variable or a one-dimensional array.
18. Declaration of arrays?
Arrays must be declared before they are used. The general form of array
declaration is
type variable-name[size]
The type specifies the type of element that will be contained in the array, such as int,
float, or char and the size indicates the maximum number of elements that can be stored
inside the array. For example,
float height[50];
19. What is meant by Two-dimensional arrays?
Two-dimensional arrays are used in situation where a table of values needs to be
stored in an array.
These can be defined in the same fashion as in one dimensional array, except
separate pair of square brackets is required for each subscript.
20. Define passing array to functions?
An entire array can be passed to a function as an argument. To pass an array to a
function, the array name must appear by itself, without brackets or subscripts, as an
actual argument within the function call.
21. What are the ways to initialize array?
The values can be initialized to an array, when they are declared like ordinary
variables, otherwise they hold garbage values.
The array can be initialized in the following two ways:
 At compile time
 At run time.
22. What are multi-dimensional arrays?CSE-WEB-PORTAL facebook
19
Multi-dimensional arrays are defined in much the same manner as onedimensional arrays, except that a separate pair of square brackets is required for each
subscript. Thus a two-dimensional array will require two pairs of square brackets; a threedimensional array will require three pairs of square brackets and so on.
In general terms a multi-dimensional array definition can be written as
storage-class data-type array[expression 1][expression 2]…..[expression n].
23. Define string?
In ‘C’ language the array of character, digits, and symbols enclosed within
quotation marks are called as string otherwise strings are array of characters. Null
character (‘\0’) is used to mark the end of the string.
Ex: char name[] = {‘b’,’a’,’c’}
24. How to declare and initialize string variables?
A string variable is any valid C variable name and is always declared as an array.
The general form of declaration of a string variable is
Char string_name[size];
The size determines the number of characters in the string name
Character arrays may be initialized when they are declared. C permits a character array to
be initialized in either of the following two forms:
Static char city[9]= ”NEW YORK”;
Static char city[9]= {‘N’.’E’,’W’,’Y’,’K’}
25. List some string functions?
 strlen( )
 strcpy( )
 strcat( )
 strcmp( )
 strlwr( )
 strrev( )
26. Define enumeration data types?
The C provides user defined data type which is called enumerated data type i.e,
the programmer can create their own data type and define what values the variables of
these data types can hold. It is defined as follows:
Syntax:
Enum tagname
{
enum 1;
enum 2;
…….
…….
enum n;
};CSE-WEB-PORTAL facebook
20
27. What are the three elements of user defined function?
 Function definition
 Function declaration
 Function
POINTERS
1. What is a pointer?
A pointer is a variable it may contain the memory address of another variable.
Pointer can have any name that is legal for other variable. It is declared in the same
manner like other variable. It is always denoted by ‘*’ operator.
1. What is meant by null pointer?
A pointer is said to be a null pointer when its right value is 0. A null pointer can
never point to a valid data. For checking a pointer , if it is assigned to 0, then it is a null
pointer and is not valid.
Example: int *a;
int *b;
b=a=0;
Hence b and a become null pointers after the integer value of 0 is assigned to them.
2. Compare call by value and call by reference
Call by Value Call by Reference
Different memory locations are
occupied by formal and actual
arguments
Same memory location occupied by
formal and actual arguments and there
is a saving of memory location.
Any alteration in the value of the
arguments passed is local to the
function and is not accepted in the
calling program.
Any alteration in the value of the
argument passed is accepted in the
calling program.
The usual method to call a function in
which only the value of the variable is
passed as an argument.
The address of the variable is passed
as an argument.
3. Write advantages of using pointers?
Pointers provides the following benefits
a) Pointers are more compact and efficient code.
b) Pointers can be used to achieve clarity and simplicity.
c) Pointers provides a way to return multiple data items from a function
using its function arguments.
d) Pointers enables us to access the memory directly.
4. Write a program to print address and value of variable.
/* program to print address of variable sno and value of variable sno */
#include<stdio.h>
main()
{CSE-WEB-PORTAL facebook
21
/*local definition*/
int sno =39;
/*statements  */
printf (“Address of sno=%u”, &sno);
printf(“Value of sno =%d”,sno);
}/*main*/
5. Define arrays of pointer?
Array notation is a form of relative addressing. The compiler treats the subscripts as a
relative offset from the beginning of  the array. When a pointer variable is set to the start
of  an array and is incremented to find the next element, absolute addressing is being
implemented.
6. Give a syntax of structure pointer?
Pointer pointing to a structure is known as structure pointers
Struct
{
member 1;
member 2;
}Variable, *ptr;
7. What is meant by dynamic memory allocation ?
Dynamic allocation is a pretty unique feature to C. It enables us to create data
types and structures of any size and length to suit our programs need within the program.
The data items in every ‘C’ program are dynamic in nature. ie , the data items in
source program can be changed during the program execution.
8. List Dynamic memory allocation function?
Function Meaning
malloc() Used to allocate blocks of memory in required size of
bytes.
free() Used to release previously allocated memory space.
calloc() Used to allocate memory space for an array of elements.
realloc() Used to modify the size of the previously allocated
memory space.
9.Define malloc() , calloc() function ?
malloc()
It is used to allocate block of memory .It allocates a block of memory of
specified size and return a pointer of type void .
calloc()
It is used for allocating memory space during the program execution for derived
data types such as arrays ,structures etc.
10. Define static memory allocation ?CSE-WEB-PORTAL facebook
22
It is allocated during compilation time when a variable is declared based on their
type ,compiler allocates space in memory, these variables can be indirectly
accessed with the help of pointer variable by assigning address of the variable to
the pointer variable .
11. What is meant by dynamic memory allocation?
Dynamic allocation is a pretty unique features of C. It enables us to create data
types and structures of any size and length to suit our programs need within the program
STRUCTURES UNIONS AND FILE HANDLING
11.Define structure ?
It contains one or more data items of different data type in which the individual
elements are of different type.
12. Define structure declaration with example ?
The structure can be declared with the keyword struct following the name and
opening brace with data elements of different type then closing brace with
semicolon,  as shown below
Syntax
struct  structure_name
{
struct_element 1;
struct_element 2;
……
struct_element n;
};
struct structure_name v1,v2,…..,vn;
Here,  v1,v2,…..,vn are structure variables.
Example
struct std
{ int no;
char name[10];
int marks;
};
struct std s1,s2;
13. How structure elements can  be accessed ?
After declaring the structure type , variable members , the member of the       structure
can be accessed by using structure variable along with the dot operator.(.)
Example:
struct book
{ int no;
char name[10];
};
struct book  b1;
For accessing the structure members from the above exampleCSE-WEB-PORTAL facebook
23
b1.no;   b1.name; where ‘b1’ is the structure variable.
14. Differentiate array and structure
Array Structure
An array is a collection of
similar data types
It is a collection of different data types
It is derived data type It is user defined data type
It behaves like a built in data
type
It must be declared and defined
An array can be increased or
decreased
Structure elements can be added necessary
15. Define Union?
Union is derived data type and it is declared like structure All the members
of the union use the same location .A union may contain many members of
different data type.
16. Differentiate Union and structure
Union Structure
All the members of union
share the same location
Each  member is allocated their own
memory
Key word union is used here Here struct keyword is used
Different interpretation for
same memory location is
possible
Any members can be accessed at any time
without the loss of data
17. Define nested structure?
If a structure contain more than one structure as its members is known as nested
structure.
Example
struct address
{
char addr1[20];
char addr2[20];
char town[20];
);
This structure can be used as a member in another structure as
struct employee
{
int code;
char name[20];
struct address addr;
};
struct employee emp1;CSE-WEB-PORTAL facebook
24
18. What is a self-referential structure?
A structure consist of at least a pointer member pointing to the same structure is
called as self referential structure
19. What is meant by files?
A file is collection of related information that is permanently stored in a disk
and allows us to access and alter the information whenever necessary
20. 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 .
23. What is the difference between library function and user-defined function?
Library functions are the function which are already written in some standard
libraries.
User-defined function means the function which are written or created by the user
to perform a particular task.CSE-WEB-PORTAL facebook
25
GE2112   FUNDAMENTALS OF COMPUTING AND PROGRAMMING
AIM:
To provide an awareness to Computing and Programming
OBJECTIVES:
 To enable the student to learn the major components of a computer system
 To know the correct and efficient ways of solving problems
 To learn to use office automation tools
 To learn to program in C
UNIT I INTRODUCTION TO COMPUTERS 9
Introduction – Characteristics of Computers – Evolution of Computers - Computer Generations –
Classification of Computers – Basic Computer organization – Number Systems
UNIT II COMPUTER SOFTWARE 9
Computer Software –Types of Software – Software Development Steps – Internet Evolution -
Basic Internet Terminology – Getting connected to Internet Applications.
UNIT III PROBLEM SOLVING AND OFFICE APPLICATION SOFTWARE     9
Planning the Computer Program – Purpose – Algorithm – Flow Charts – Pseudocode -
Application Software Packages- Introduction to Office Packages (not detailed commands for
examination).
UNIT IV INTRODUCTION TO C 9
Overview of C – Constants, Variables and Data Types – Operators and Expressions – Managing
Input and Output operators – Decision Making - Branching and Looping.
UNIT V FUNCTIONS AND POINTERS 9
Handling of Character Strings – User-defined Functions – Definitions – Declarations - Call by
reference – Call by value – Structures and Unions – Pointers – Arrays – The Preprocessor –
Developing a C Program : Some Guidelines
TOTAL: 45 PERIODS
TEXT BOOKS:
1. Ashok.N.Kamthane,“ Computer Programming”, Pearson Education (India) (2008).
2. Behrouz A.Forouzan and Richard.F.Gilberg, “A Structured Programming Approach
Using C”, II Edition, Brooks-Cole Thomson Learning Publications, (2007).
REFERENCES:
1. Pradip Dey, Manas Ghoush, “Programming in C”, Oxford University Press. (2007).
2. Byron Gottfried, “Programming with C”, 2
nd
Edition, (Indian Adapted Edition), TMH
publications, (2006).
3. Stephen G.Kochan, “Programming in C”, Third Edition, Pearson Education India,
(2005).
4. Brian W.Kernighan and Dennis M.Ritchie, “The C Programming Language”, Pearson
Education Inc., (2005).
5. E.Balagurusamy, “Computing fundamentals and C Programming”, Tata McGraw-Hill
Publishing Company Limited, (2008).
6. S.Thamarai Selvi and R.Murugan, “C for All”, Anuradha Publishers, (2008).

No comments:

Post a Comment

Slider

Image Slider By engineerportal.blogspot.in The slide is a linking image  Welcome to Engineer Portal... #htmlcaption

Tamil Short Film Laptaap

Tamil Short Film Laptaap
Laptapp

Labels

About Blogging (1) Advance Data Structure (2) ADVANCED COMPUTER ARCHITECTURE (4) Advanced Database (4) ADVANCED DATABASE TECHNOLOGY (4) ADVANCED JAVA PROGRAMMING (1) ADVANCED OPERATING SYSTEMS (3) ADVANCED OPERATING SYSTEMS LAB (2) Agriculture and Technology (1) Analag and Digital Communication (1) Android (1) Applet (1) ARTIFICIAL INTELLIGENCE (3) aspiration 2020 (3) assignment cse (12) AT (1) AT - key (1) Attacker World (6) Basic Electrical Engineering (1) C (1) C Aptitude (20) C Program (87) C# AND .NET FRAMEWORK (11) C++ (1) Calculator (1) Chemistry (1) Cloud Computing Lab (1) Compiler Design (8) Computer Graphics Lab (31) COMPUTER GRAPHICS LABORATORY (1) COMPUTER GRAPHICS Theory (1) COMPUTER NETWORKS (3) computer organisation and architecture (1) Course Plan (2) Cricket (1) cryptography and network security (3) CS 810 (2) cse syllabus (29) Cyberoam (1) Data Mining Techniques (5) Data structures (3) DATA WAREHOUSING AND DATA MINING (4) DATABASE MANAGEMENT SYSTEMS (8) DBMS Lab (11) Design and Analysis Algorithm CS 41 (1) Design and Management of Computer Networks (2) Development in Transportation (1) Digital Principles and System Design (1) Digital Signal Processing (15) DISCRETE MATHEMATICS (1) dos box (1) Download (1) ebooks (11) electronic circuits and electron devices (1) Embedded Software Development (4) Embedded systems lab (4) Embedded systems theory (1) Engineer Portal (1) ENGINEERING ECONOMICS AND FINANCIAL ACCOUNTING (5) ENGINEERING PHYSICS (1) english lab (7) Entertainment (1) Facebook (2) fact (31) FUNDAMENTALS OF COMPUTING AND PROGRAMMING (3) Gate (3) General (3) gitlab (1) Global warming (1) GRAPH THEORY (1) Grid Computing (11) hacking (4) HIGH SPEED NETWORKS (1) Horizon (1) III year (1) INFORMATION SECURITY (1) Installation (1) INTELLECTUAL PROPERTY RIGHTS (IPR) (1) Internal Test (13) internet programming lab (20) IPL (1) Java (38) java lab (1) Java Programs (28) jdbc (1) jsp (1) KNOWLEDGE MANAGEMENT (1) lab syllabus (4) MATHEMATICS (3) Mechanical Engineering (1) Microprocessor and Microcontroller (1) Microprocessor and Microcontroller lab (11) migration (1) Mini Projects (1) MOBILE AND PERVASIVE COMPUTING (15) MOBILE COMPUTING (1) Multicore Architecute (1) MULTICORE PROGRAMMING (2) Multiprocessor Programming (2) NANOTECHNOLOGY (1) NATURAL LANGUAGE PROCESSING (1) NETWORK PROGRAMMING AND MANAGEMENT (1) NETWORKPROGNMGMNT (1) networks lab (16) News (14) Nova (1) NUMERICAL METHODS (2) Object Oriented Programming (1) ooad lab (6) ooad theory (9) OPEN SOURCE LAB (22) openGL (10) Openstack (1) Operating System CS45 (2) operating systems lab (20) other (4) parallel computing (1) parallel processing (1) PARALLEL PROGRAMMING (1) Parallel Programming Paradigms (4) Perl (1) Placement (3) Placement - Interview Questions (64) PRINCIPLES OF COMMUNICATION (1) PROBABILITY AND QUEUING THEORY (3) PROGRAMMING PARADIGMS (1) Python (3) Question Bank (1) question of the day (8) Question Paper (13) Question Paper and Answer Key (3) Railway Airport and Harbor (1) REAL TIME SYSTEMS (1) RESOURCE MANAGEMENT TECHNIQUES (1) results (3) semester 4 (5) semester 5 (1) Semester 6 (5) SERVICE ORIENTED ARCHITECTURE (1) Skill Test (1) software (1) Software Engineering (4) SOFTWARE TESTING (1) Structural Analysis (1) syllabus (34) SYSTEM SOFTWARE (1) system software lab (2) SYSTEMS MODELING AND SIMULATION (1) Tansat (2) Tansat 2011 (1) Tansat 2013 (1) TCP/IP DESIGN AND IMPLEMENTATION (1) TECHNICAL ENGLISH (7) Technology and National Security (1) Theory of Computation (3) Thought for the Day (1) Timetable (4) tips (4) Topic Notes (7) tot (1) TOTAL QUALITY MANAGEMENT (4) tutorial (8) Ubuntu LTS 12.04 (1) Unit Wise Notes (1) University Question Paper (1) UNIX INTERNALS (1) UNIX Lab (21) USER INTERFACE DESIGN (3) VIDEO TUTORIALS (1) Virtual Instrumentation Lab (1) Visual Programming (2) Web Technology (11) WIRELESS NETWORKS (1)

LinkWithin