You are on page 1of 68

FOCP-2MARKS FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING UNIT I INTRODUCTION TO COMPUTERS Introduction Characteristics of Computers Evolution of Computers Computer

uter Generations Classification of Computers Basic Computer organization Number Systems. 2 MARKS 1. Define computers? A computer is a programmable machine or device that performs pre-defined or programmed computations or controls operations that are expressible in numerical or logical terms at high speed and with great accuracy. (Or) Computer is a fast operating electronic device, which automatically accepts and store input data, processes them and produces results under the direction of step by step program. 2. Why computer is known as data processing system? (MAY 2009) Any process that uses a computer program will enter data and summarize, analyze or otherwise convert data into usable information. The process may be automated and run on a computer. It involves recording, analyzing, sorting, summarizing, calculating, disseminating and storing data. Thus Computer is known as data processing system. 3. What is Data and Information? Data - Data is the fact or raw material for the information processing.

Information The processed data is called information. 4. What are the basic operations of Computer? 1) It accepts data or instructions by way of input. 2) It stores data. 3) It can process data as required by the user. 4) It gives results in the form of output. 5) It controls all operations inside a computer. 5. Give the applications computer? Word Processing Internet Desktop publishing Digital video or audio composition Mathematical Calculations Robotics Weather analysis 6. What are the characteristics of computers? (JAN 2009) Speed Accuracy. Automation. Endurance. Versatility. Storage. Cost Reduction. 7. How will you classify computer systems? (JAN 2009)

Based on physical size, performance and application areas, we can generally divide computers into four major categories: 1. Micro computer 2. Mini Computer 3. Mainframe computer and 4. Super Computer 8. Specify the Electronic components used for different computer generations. Generations Electronic Components I Generation Vacuum tubes II Generation Transistors III Generation Integrated Circuits IV Generation Microprocessors V Generation Artificial Intelligence 9. Compare Computer with calculator SNO Characteristic Calculator Computer 1 Speed Fast Much Fast 2 Performance Simple Calculation and numeric processing. Complex problem and non-numeric processing also. 3 Memory Less internal memory, no permanent storage, temporary storage only. Large internal memory and large permanent storage available. 4 Machine Electronic Device. Electronic Device.

5 Operation Arithmetic. Arithmetic and logical. 10. What are the languages used in computer generations. Generations Languages used I Generation Machine Language. II Generation Assemble Language, Mnemonics III Generation High Level Language, BASIC, PASCAL, COBOL, FORTRON. IV Generation 4GL V Generation Artificial Intelligence. 11. Expand ENIVAC, ABC, EDVAC, EDSAC and UNIVAC. (JAN 2010) ENIAC Electronic Numerical Integrator and Calculator. ABC Atanasoff and Berry Computer. EDVAC Electronic Discrete Variable Automatic Calculator. EDSAC Electronic Delay Storage Automatic Calculator. UNIVAC UNIversal Automatic Computer. 12. Who is the father of computer? Why? Charles Babbage is the father of computer, because the parts and working principle of the Analytical Engine, which is invented by Charles Babbage is similar to todays computer. 13. Expand COBOL, BASIC, FORTRON and IBM. COBOL Common Business Oriented Language. BASIC - Beginners All Purpose Symbolic Instruction Code. FORTRON FORmula TRANslation. IBM International Business Machine. 14. Expand IC, SSI, MSI, LSI, and VLSI.

IC Integrated Circuit. SSI - Small Scale Integration. MSI - Medium Scale Integration. LSI - Large Scale Integration. VLSI - Very Large Scale Integration. 15. What are the components of the computer systems? Basic components of the computer system are Input Unit, Central Processing Unit, Secondary Storage Unit and Output Unit. 16. What are the functions in the input unit? An input device is a device that is used to input data or information into a computer. Some examples of input devices include: Keyboards. Computer mice. Light Pen. Digitizer. Touchpad. Trackball. Image scanner. Webcam. Video capture / tuner cards. Microphones. MIDI instruments. 17. What are the functions in the output unit? In computers, a unit which delivers information from the computer to an external device or from internal storage to external storage.

Speakers. Printer. Headphone. Monitor (or) Visual Display Unit (VDU). Plotter. 18. What is an ALU? Arithmetic logic unit, the part of a computer that performs all arithmetic computations, such as addition and multiplication, and all logical operations such s comparison operations. The ALU is one component of the CPU (central processing unit). 19. Define Clients and Servers. A client is generally a single-user PC or workstation that provides a highly userfriendly interface to the end user. It runs client processes, which send service requests to the server. A server is generally a relatively large computer that manages a shared resource and provides a set of shared user services to the clients. It runs the server process, which services client requests for use of the resource managed by the server. The network may be single LAN or WAN or an internet of networks. 20. What is a CPU? The CPU (central processing unit) is the part of a computer controls the interpretation and execution of instructions. Generally, the CPU is a single microchip. (Or) The computing part of the computer. Also called the "processor," it is made up of the

The CPU, clock and main memory make up a computer. A complete computer system requires the addition of control units, input, output and storage devices and an operating system. 21. What is meant by generation in computer terminology? Generation is the period of years in which the computers are enhanced as previous. 22. Define personal computers? A small, relatively inexpensive computer designed for an individual user. In price, personal computers range anywhere from a few hundred dollars to thousands of dollars. All are based on the microprocessor technology that enables manufacturers to put an entire CPU on one chip. Example: Businesses use personal computers for word processing, accounting, desktop publishing, and for running spreadsheet and database management applications. At home, the most popular use for personal computers is for playing games. 23. Define Mainframe computer? Mainframes are computers used mainly by large organizations for critical applications, typically bulk data processing such as census, industry and consumer statistics, enterprise resource planning, and financial processing. The term probably had originated from the early mainframes, as they were housed in enormous, room-sized metal boxes or frames. 24. Define Mini computers?

A mini computer is a multi-user or time-sharing system. It is used for medium scale data processing such as Bank account processing, Payroll processing etc., Mini computer process greater storage capacity and larger memories as compared to micro computer. 25. Define super computer? The fastest type of computer. Supercomputers are very expensive and are employed for specialized applications that require immense amounts of mathematical calculations. control unit and ALU. Today, the CPUs of almost all computers are contained on a singlec chip. For example, weather forecasting requires a supercomputer. Other uses of supercomputers include animated graphics, fluid dynamic calculations, nuclear energy research, and petroleum exploration. 26. Define Software? Computer instructions or data, anything that can be stored electronically is software. (Or) Computer software or just software is a general term used to describe the role that computer programs, procedures and documentation in a computer system. The term includes: 27. Define Hardware? Computer hardware - (computer science) the mechanical, magnetic, electronic, and electrical components making up a computer system hardware. Hardware includes not only the computer proper but also the cables, connectors, power supply units, and peripheral devices such as the keyboard, mouse, audio speakers, and

printers. 28. What is an instruction? An instruction is a basic command. The term instruction is often used to describe the most rudimentary programming commands. For example, a computer's instruction set is the list of all the basic commands in the computer's machine language. 29. Define memory? Computer memory refers to devices that are used to store data or programs (sequences of instructions) on a temporary or permanent basis for use in an electronic digital computer. 30. What is a volatile and non-volatile memory? Volatile memory: also known as volatile storage is computer memory that requires power to maintain the stored information, unlike non-volatile memory which does not require a maintained power supply. It has been less popularly known as temporary memory. Non-volatile memory: nonvolatile memory, NVM or non-volatile storage, is computer memory that can retain the stored information even when not powered. Examples of non-volatile memory read-only memory flash memory most types of magnetic computer storage devices (e.g.hard / floppy disks & magnetic tape) optical discs Early computer storage methods such as paper tape and punch cards.

Non-volatile memory is for long-term persistent storage. The most widely used form of primary storage today is a volatile form of random access memory (RAM), meaning that when the computer is shut down, anything contained in RAM is lost. 31. What is a primary memory? The primary memory or the main memory is part of the main computer system. The processor or the CPU directly stores and retrieves information from it. This memory is accessed by CPU, in random fashion. That means any location of this memory can be accessed by the CPU to either read information from it, or to store information in it. Types of Primary Memory: RAM is RWM (Read Write Memory), the CPU can write and read information from any primary memory location implemented using RAM. ROM stands for Read Only Memory. 32. What is a secondary memory? The secondary memory is much slower and also less costly. It stores the data permanently unless it is erased. Examples: Floppy disk storage media Hard disk CD / DVD Pen drive Memory chips etc., 33. What is a microprocessor?

A microprocessor incorporates most or all of the functions of a central processing unit (CPU) on a single integrated circuit (IC). The first microprocessors emerged in the early 1970s and were used for electronic calculators, using binary-coded decimal (BCD) arithmetic on 4-bit words. 34. What is transistor? A device composed of semiconductor material that amplifies a signal or opens or closes a circuit. Invented in 1947 at Bell Labs, transistors have become the key ingredient of all digital circuits, including computers. Microprocessors contain tens of millions of microscopic transistors. 35. What is an IC? How does it help in reducing the size of Computers? IC is an Integrated Circuit; it integrates large number of circuit elements into very small surface (less than 5mm square) of silicon known as Chips. 36. What are the components of the computer systems? Input Unit Central Processing Unit. Secondary Storage Unit. Output Unit. 37. Define number system. The term computer numbering formats refers to the schemes implemented in digital computer and calculator hardware and software to represent numbers. For example, if one multiplies: one might perhaps expect to get a result of exactly 1, which is the correct answer when applying an exact rational number or algebraic model. In

practice, however, the result on a digital computer or calculator may prove to be something such as precisely 0.9999999999999999 (as one might find when doing the calculation on paper) or, in certain cases, perhaps 0.99999999923475. 38. What are the types of Number System? Positional Number System. Non-Positional Number System. 39. What are the positional number systems and what is their base? Number System Base Decimal Number System 10 Binary Number System 2 Octal Number System 8 Hexa Decimal Number System 16 40. Define (1) Nibble (2) Bit (3) Byte? (1) In computers and digital technology, a nibble (pronounced NIHB-uhl; sometimes spelled nybble) is four binary digits or half of an eight-bit byte. A nibble can be conveniently represented by one hexadecimal digit. (2) A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single binary value, either 0 or 1. Although computers usually provide instructions that can test and manipulate bits, they generally are designed to store data and execute instructions in bit multiples called bytes.

(3) In most computer systems, a byte is a unit of data that is eight binary digits long. A byte isthe unit most computers use to represent a character such as a letter, number, or typographic symbol (for example, "g", "5", or "?"). A byte can also hold a string of bits that need to be used in some larger unit for application purposes. 41. What is a Base? A base is the total number of bits in the number system. 42. What is meant by conversion in number system? Conversion is the process of converting from one number system to another number system. Example: Decimal to Octal. Hexadecimal to Decimal 43. Define (1) MSB (2) LSB? (1) In computing, the most significant bit (MSB) is the bit position in a binary number having the greatest value. The MSB is sometimes referred to as the left-most bit on big-endian architectures, due to the convention in positional notation of writing more significant digits further to the left. The MSB can also correspond to the sign of a signed binary number in one or two's complement notation. "1" meaning negative and "0" meaning positive. (2) In computing, the least significant bit (LSB) is the bit position in a binary integer giving the units value, that is, determining whether the number is even or odd. The LSB is

sometimes referred to as the right-most bit, due to the convention in positional notation of writing less significant digit further to the right. 44. Specify the method to convert decimal number system. 1. Remainder method. 2. Power method. 45. What is a binary number system? The binary numeral system or base-2 number system represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2. 46. What is a decimal number system? The decimal numeral system (also called base ten or occasionally denary) has ten as its base. It is the most widely used numeral base. Examples are Roman numerals. Brahmi numerals. Chinese numerals. Hindu-Arabic numerals. Roman numerals have symbols for the decimal powers (1, 10, 100, and 1000). 47. What is an octal number system? The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right). For example:

112 in octal is equal to 64+8+2 = 74 in decimal. Octal is sometimes used in computing instead of hexadecimal. 48. What is a hexadecimal number system? In mathematics and computer science, hexadecimal (also base-16, hexa, or hex) is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F (or a through f) to represent values ten to fifteen. Its primary use is as a human-friendly representation of binary coded values, so it is often used in digital electronics and computer engineering. Since each hexadecimal digit represents four binary digits (bits)also called a nibbleit is a compact and easily translated shorthand to express values in base two. 49. Write short notes on primary storage. Stores and provides very fast. This memory is generally used to hold the program being currently executed in the computer, the data being received from the input unit, the intermediate and final results of the program. The primary memory is temporary in nature. The data is lost, when the computer is switched off. In order to store the data permanently, the data has to be transferred to the secondary memory. 50. Write short notes on secondary storage. Secondary storage is used like an archive. It stores several programs, documents, data

bases etc. the programs that we run on the computer are first transferred to the primary memory before it is actually run. Whenever the results are saved, again they get stored in the secondary memory. The secondary memory is slower and cheaper than the primary memory. Some of 1 the commonly used secondary memory devices are Hard disk, CD, etc., 51. List out the types of computers based on size, memory capacity. 1. Micro computers 2. Mini computers 3. Mainframe computers 4. Super computers 53. What are the major operations of computers? A computer performs basically 5 major operations or functions irrespective of their size they are It accepts data or instructions by way of input. It stores data. It can process data as required by the user. It gives results in the form of output. It controls all operations inside a computer. 54. Write short notes on cache memory. The speed of CPU is extremely high compared to the access time of main memory. Therefore, the performance of CPU decreases due to the slow speed of main memory. To decrease the mismatch in operating speed, a small memory chip is attached between CPU

and main memory whose access time is very close to the processing speed of CPU. It is called CACHE memory. CACHE memories are accessed much faster than conventional RAM. It is used to store programs or data currently being executed or temporary data frequently used by the CPU. So each memory makes main memory to be faster and larger than it really is. It is also very expensive to have bigger size of cache memory and its size is normally kept small. 55. Write the binary and octal equivalent of hexadecimal number 7BD? (APR 2009) Binary Equivalent of 7BD = (0111 1011 1101)2 Octal Equivalent of 7BD = (011 110 111 101) = (3675)8 56. Give any two tasks, which humans perform better than computers? (JAN 2009) Humans can communicate better than computers. Humans are much reliable than computers. 57. What is the use of computer in medicine and healthcare? (JAN 2009) Study of biological vision system. Medical Imaging. Mobile healthcare technology. Nano technology. Bioinformatics. 58. Convert binary number 100110 into its octal equivalent? (JAN 2009)

Octal equivalent of 100110 = (100 110) = (46)8 59. What are registers? (JAN 2009) A special, high-speed storage area within the CPU. All data must be represented in a register before it can be processed. For example, if two numbers are to be multiplied, both numbers must be in registers, and the result is also placed in a register. 60. Differentiate analog and digital computers? (JAN 2010) S No Analog Computer Digital Computer 1 Process measured data Process discrete data 2 Analog computers are not precise Digital computers are more precise 3 Processing speed is low. Processing speed is high. 4 Less accuracy. More accuracy. 61. Find the decimal equivalent of hexadecimal number 4D.C8 (JAN 2010) 4D.C8 = 4 X 161 + 13 X 162 + 12 X 16-1 + 8 X 16-2 = 64 + 13 +0.75 + 0.03125 = (77.78)2 62. Convert hexadecimal number into binary equivalent of EBC (JAN 2010) Binary equivalent of EBC = (1110 1011 1100)2

080230001 - Fundamentals of Computing and Computer Programming Compiler: It is a program which is used to convert the high level language program into machine language. Assembler: It is a program which is used to convert the assembly level language program into machine language. Interpreter: It is a program; it takes one statement of a high level language program, translates it into machine language instruction and then immediately executes the resulting machine language instruction. 11. What is Device Driver? In computing, a device driver or software driver is a computer program allowing higherlevel computer programs to interact with a hardware device. A driver typically communicates with the device through the computer bus or communications subsystem to which the hardware connects. 12. What is the purpose of a Device Driver? A device driver simplifies programming by acting as a translator between a hardware device and the applications or operating systems that use it. Programmers can write the higher-level application code independently of whatever specific hardware device it will ultimately control, because code and device can interface in a standard way, regardless of the software superstructure or of underlying hardware. Every version of a device, such as a

printer, requires its own hardware-specific specialized commands. 13. What is a linker? A linker is a program that combines object modules to form an executable program. Many programming languages allow you to write different pieces of code, called modules, separately. This simplifies the programming task because you can break a large program into small, more manageable pieces. Modules has to be put together. This is the job of the linker. In addition to combining modules, a linker also replaces symbolic addresses with real addresses. Therefore, you may need to link a program even if it contains only one module. 14. What is a loader? In computing, a loader is the part of an operating system that is responsible for one of the essential stages in the process of starting a program, loading programs, that is, starting up programs by reading the contents of executable files (executables- files containing program text) into memory, then carrying out other required preparatory tasks, after which the program code is finally allowed to run and is started when the operating system passes control to the loaded program code. 15. What is Booting? In computing, booting (also known as "booting up") is a bootstrapping process that starts operating systems when the user turns on a computer system. A boot sequence is the initial set of operations that the computer performs when power is switched on. The boot

loader typically loads the main operating system for the computer. 16. What is application software? An application software is a set of programs, that allows the computer to perform a specific data processing for the user. 17. How can you obtain required software? Buying Pre-defined software. Buying customized software. Developing the software. 080230001 - Fundamentals of Computing and Computer Programming

Downloading from the Internet. 18. What are the categories of application software? Customized Application Software. General Application Software. 19. Define the System. System is a group of interrelated components working together towards a common goal. 20. Specify the personnels, who are responsible for system design and implementation. System Personnel. System Analyst. System Designer. Programmers. Users. 21. What is system development cycle?

System development cycle is the sequence of events considered by the system developers to build the new system or to replace the old one. 22. What are the phases of Software Development Cycle? Requirement Analysis. Feasibility study. System Analysis and Design. Coding / Development. Testing. Implementation. Maintenance. 23. What is Software Requirement Specification (SRS) document? The Software Required Specification (SRS) Document is produced at the end of Requirement Analysis stage, which specifies all requirements of the customer. 24. What is meant by Testing? Testing is the process of executing the proposed software with sample or test data and put into regular use. 25. How the system can be tested? Unit Testing. Integration Testing. System Testing. User Acceptance Test and Installation Testing. 26. What is Design? The Design is the process of specifying the detailed operation of the system. 27. Classify the Design phase. High-Level Design (System Design)

Low-Level Design (Detailed Design) 28. What is meant by Coding? Coding is the process of writing program in a programming language. 29. What is Implementation & Maintenance? Implementation is the process of putting the system into regular use. Maintenance is the process of enhancing the system after installation. 30. What is Internet? 080230001 - Fundamentals of Computing and Computer Programming

Internet is a collection of interconnected computer networks linked by copper wires, fiber optic cables and wireless connections etc, 31. Define protocol? In computing, a protocol is a set of rules which is used by computers to communicate with each other across a network. A protocol is a convention or standard that controls or enables the connection, communication, and data transfer between computing endpoints. In its simplest form, a protocol can be defined as the rules governing the syntax, semantics, and synchronization of communication. Protocols may be implemented by hardware, software, or a combination of the two. At the lowest level, a protocol defines the behavior of a hardware connection. 32. What is Web? The Web is a collection of interconnected documents and other resources linked by hyperlinks and URLs.

33. What is ARPANET? It is acrimony for Advanced Research Project Agency NET, created by Department of Defence (DOD). 34. What is a Web page? A webpage or web page is a document or resource of information that is suitable for the World Wide Web and can be accessed through a web browser and displayed on a computer screen. This information is usually in HTML or XHTML format, and may provide navigation to other web pages via hypertext links. 35. Define Website? A website is a collection of WebPages, images, videos or other digital assets that is based on one or more web servers, usually accessible through the Internet. 36. What is an IP? IP stands for Internet Protocol, which is the language, that computer used to communicate over the Internet. 37. Name some of the services of Internet or Internet applications? (JAN 2009) E-Mail. Chat. Remote Access. File Sharing. Voice Telephony. File Transfer Protocol. Telnet.

Internet Relay Chat. Video Conferencing. 38. What is HTTP? Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. Its use for retrieving inter-linked resources, called hypertext documents, led to the establishment of the World Wide Web in 1990. There are two major versions, HTTP/1.0 that uses a separate connection for every document and HTTP/1.1 that can reuse the same connection to download, for instance, images for the just served page. Hence HTTP/1.1 may be faster as it takes time to set up the connections. 080230001 - Fundamentals of Computing and Computer Programming

39. What is TCP/IP? Transmission Control Protocol/Internet Protocol, the suite of communications protocols used to connect hosts on the Internet. TCP/IP uses several protocols, the two main ones being TCP and IP. TCP/IP is built into the UNIX operating system and is used by the Internet, making it the de facto standard for transmitting data over networks. Even network operating systems that have their own protocols, such as Netware, also support TCP/IP. 40. Define URL? A Uniform Resource Locator (URL) is a subset of the Uniform Resource Identifier (URI) that specifies where an identified resource is available and the mechanism for

retrieving it. In popular usage and in many technical documents and verbal discussions it is often incorrectly used as a synonym for URI.[1] In popular language, a URI is also referred to as a Web address. 41. Define ISP? An Internet service provider (ISP, also called Internet access provider, or IAP) is a company that offers its customers access to the Internet. The ISP connects to its customers using a data transmission technology appropriate for delivering Internet Protocol datagrams, such as dial-up, DSL, cable modem, wireless or dedicated high-speed interconnects. ISPs may provide Internet e-mail accounts to users which allow them to communicate with one another by sending and receiving electronic messages through their ISP's servers. ISPs may provide other services such as remotely storing data files on behalf of their customers, as well as other services unique to each particular ISP. 42. Define Home page? The homepage (often written as home page) is the URL or local file that automatically loads when a web browser starts or when the browser's "home" button is pressed. One can turn this feature off and on, as well as specify a URL for the page to be loaded. The term is also used to refer to the front page, web server directory index, or main web page of a website of a group, company, organization, or individual. 43. Define Web Browser?

A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier (URI) and may be a web page, image, video, or other piece of content. Hyperlinks present in resources enable users to easily navigate their browsers to related resources. The major web browsers are Windows Internet Explorer, Mozilla Firefox, Apple Safari, Google Chrome, and Opera. 44. Differentiate Application and System Software. (JAN / FEB 2009) S No Application Software System Software 1 Used to perform specific data processing or computational tasks to the user. System software is the code that controls the hardware. 2 It runs on top of the operating system and performs a number of tasks for the computer system. It forms the foundation and takes care of the most basic tasks of the computer system. 3 Example: MS-Word Example: Operating System 080230001 - Fundamentals of Computing and Computer Programming

45. Difference between web page and website. (JAN 2009/JAN 2010)

S No Web page Web site 1 A web page is one screen full of information (from a web site) that may contain links to other pages in the web site or links to external information. A website is a collection of one or more web pages designed to convey information on a particular subject or theme to a web user. 2 Every webpage should contain a Page Title in the head section. A web page may contain text, animation or graphics elements. Website will have a domain name. Example: A company will have a web site providing structured information about the company 3 Web page is an single entity. Web site can have more than one web page. 46. Differentiate machine language and high level language. (JAN 2010) S No Machine language High level Language 1 Represented in numbers. Human readable form. 2 Directly executed by the Central Processing Unit. Should be translated into machine code by compiler / interpreter.

3 Example: ADD A, B where A and B are operands and ADD is an opcode. Example: C, C++ 47. Difference between Compiler and Interpreter. (JAN 2010) S No Compiler Interpreter 1 Executes source code into target or assembly code. Executes source code directly or to an intermediate form. 2 Compilers convert once the source program. Interpreter converts every time the program runs. 3 Languages for compiler conversion: C, C++. Languages for interpreter conversion: MATLAB, Python. 48. What is IP Address? (JAN 2009) Internet protocol address is the address of a device attached to an IP network (TCP/IP network). Every client, server and network device is assigned an IP address, and every IP packet traversing an IP network contains a source IP address and a destination IP address. 49. Name any four application software packages. (JAN 2009) Word Processors Spreadsheets

Data bases Graphics Presentations Web browsers 50. What is soft loading? (JAN 2009) A soft reboot (also known as a warm reboot) is restarting a computer under software control, without removing power or (directly) triggering a reset line. It usually, though not always, refers to an orderly shutdown and restarting of the machine. The Control-Alt-Delete key combination is used to allow the soft rebooting the system.

51. What are the steps involved in booting? (JAN 2009) First, the Power On Self Tests (POST) is conducted. These tests verify that the system is operating correctly and will display an error message and/or output a series of beeps known as beep codes depending on the BIOS manufacturer. Second, is initialization in which the BIOS look for the video card built in BIOS program and runs it. The BIOS then looks for other devices' ROMs to see if any of them have BIOSes and they are executed as well. Third, is to initiate the boot process. The BIOS looks for boot information that is contained in file called the master boot record (MBR) at the first sector on the disk. If it is searching a floppy disk, it looks at the same address on the floppy disk for a volume boot sector. Once an acceptable boot record is found the operating system is loaded which takes over control

of the computer. 52. What is the difference between text and graphical browsers? (JAN 2010) S No Text browser Graphical browser 1 No GUI. Based on GUI. 2 Links are based on text entry. Links are present as icons or images. 3 Allow users to display and interact only with text on the web pages. Allow users to display and interact with various images, present on the web pages. 4 Example: Lynx web browser Example: Internet Explorer, Netscape Navigator. UNIT III PROBLEM SOLVING AND OFFICE AUTOMATION Planning the Computer Program Purpose Algorithm Flow Charts Pseudocode -Application Software Packages- Introduction to Office Packages (not detailed commands for examination). 2 MARKS 1. What is a program? A program is a set instruction written to carryout a particular task, so that computer can perform some specified task. 2. What is algorithm? (JAN 2009) 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. 3. What are the steps to solve the problem in a computer system? Problem must be analyzed thoroughly. Solution method is broken down into a sequence of small tasks. Based on this analysis, an algorithm must be prepared to solve the problem. The algorithm is expressed in a precise notation. This notation is known as Computer Program. The Computer program is fed to the computer. The instruction in the program executes one after another and outputs the expected result. 4. How can you measure the quality of algorithm? The primary factors that are often used to judge the quality of an algorithm are time requirement, memory requirement, and accuracy of solution. 5. What are the characteristics of an algorithm? 1. In algorithms each and every instruction should be precise. 2. In algorithms each and every instruction should be unambiguous. 3. The instructions in an algorithm should not be repeated infinitely. 4. Ensure that the algorithm will ultimately terminate. 5. The algorithm should be written in sequence. 6. It looks like normal English. 7. The desired result should be obtained only after the algorithm terminates. 6. How many types the Algorithm can be represented? Normal English Program Flowchart

Pseudo code Decision table 7. What is 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.

080230001 - Fundamentals of Computing and Computer Programming 8. What is Flowchart? A Flowchart is a pictorial representation of an algorithm. It is often used by programmer as a program planning tool for organizing a sequence of step necessary to solve a problem by a computer. 9. What is the need of Flowchart symbols? Each symbol of different shapes denotes different shapes denote different types of instructions. The program logic through flowcharts is made easier through the use of symbol that has standardized planning. 10. What is pseudo code? 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. 11. What is structured programming? A structured programming is a more specific approach to solve a programming problem by using only the three basic logic structures. They are sequence logic, selection logic and Iteration logic.

12. Draw the flowchart to find the maximum among three numbers (JAN 2009)

Start Stop Get three numbers a, b, c if(a>b) && (a>c) Print a is greater True False if(b>a) && (b>c) Print b is greater True False Print c is greater

13. What are the rules for drawing a flowchart? The standard symbols should only be used. The arrowheads in the flowchart represent the direction of flow of control in the problem.

The usual direction of the flow of procedure is from top to bottom or left to right. The flow lines should not cross each other. Be consistent in using names and variables in the flowchart. Keep the flowchart as simple as possible. Words in the flowchart symbols should be common statements and easy to understand. Chart main line of logic, and then incorporate all the details of logic. If a new page is needed for flowcharting, then use connectors for better representation. Dont chart every details or the flowchart will only be graphical represented. 14. What is sequence logic? Sequence logic is used for performing instructions one after another in a sequence. 15. What is selection logic? Selection logic is used for selecting the process path out of two or more alternative paths in the program logic. It uses three control structures called if then, if thenelse and switchcase. 16. What is Iteration logic? Iteration logic is used for producing loops in program logic when one or more instructions may be executed several times depending on some condition. It uses two control structures called dowhile, and repeatuntil. 17. What are the rules for writing pseudo code? (MAY 2010) Write on statement per line. Capitalize initial keywords.

Indent to show hierarchy. End multi line structure. Keep statements language independent. 18. What are the features of word processors? Fast Permanent storage Formatting Editing Graphics OLE Spell Check Mail merge 19. How many types a documented can be viewed? * Normal view * Online layout * Outline view * Page layout view 20. What are the menus available in Ms-Word? File Edit View Insert Format Tools Table Window Help 21. What is meant by Formatting?

Formatting is the process of changing the appearance of the text in the document. 22. Specify any five toolbars available in Ms-Word? Standard Formatting Drawing Tables & Boarders WordArt etc., 23. How many Line Spacing options available in Ms-Word? Single 1.5 Lines Double At least Exactly Multiple 24. What are the Text cases available in Ms-Word? Sentence case lower case UPPER CASE Title Case tOGGLE CASE 25. What is Subscript and Superscript? The Subscript format places the text slightly below a line of normal printed text. Eg:-H2O The Superscript format places the text slightly above a line of normal printed text.

Eg:-A2+B2 26. What is Tab and what are the Tab settings available in word? Tab is used to control the alignment of text with in the document. Word provides seven types of tabs. Standard (left) tab Center tab Right tab Decimal tab Bar tab First line Indent tab Hanging Indent tab 27. Define Headers and Footers. Header allows text, page number or section titles to appear on every page of document at the top position. Footer allows text, page number or section titles to appear on every page of document at the bottom position. 28. What is a Table?

A Table is grid of rows and columns. 29. What is a Clipart? Clipart is the attractive pre-defined, pre-colored pictures available in Ms-Word office suite. 30. Define a Template. Template is a special kind of document that produces basic tools for shaping a final document.

31. Define operator and formula. Operator:-An operator is a symbol, which can do a particular action on the operands. Formula:-Is the mathematical expression used to carryout a particular process. 32. What is a function? A function is a built-in mathematical shortcut used to perform a complex formula task. 33. What are the types of functions available in Excel? There are nine types of functions available in Excel. Financial functions Date and Time functions Math and Trigonometry functions Database functions Statistical functions Text functions Lookup Reference functions Logical functions Information functions 34. What is a Label? A label is the name describing the each column and row of a cell. It appears at the left and the top of a cell.

UNIT IV INTRODUCTION TO C Overview of C Constants, Variables and Data Types Operators and Expressions Managing Input and Output operators Decision Making - Branching and

Looping. 2 MARKS 1. What are the different data types available in C? There are four basic data types available in C. 1. int 2. float 3. char 4. double 2. 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. 3. What is an Operator and Operand? An operator is a symbol that specifies an operation to be performed on operands. Example: *, +, -, / are called arithmetic operators. The data items that operators act upon are called operands. Example: a+b; In this statement a and b are called operands. 4. What is Ternary operators or Conditional operators? Ternary operators is a conditional operator with symbols ? and : Syntax: variable = exp1 ? exp2 : exp3 If the exp1 is true variable takes value of exp2. If the exp2 is false, variable takes the value of exp3. 5. What are the Bitwise operators available in C? & - Bitwise AND | - Bitwise OR ~ - Ones Complement

>> - Right shift << - Left shift ^ - Bitwise XOR are called bit field operators Example: k=~j; where ~ take ones complement of j and the result is stored in k. 6. What are the logical operators available in C? The logical operators available in C are && - Logical AND || - Logical OR ! - Logical NOT 7. What is the difference between Logical AND and Bitwise AND? Logical AND (&&): Only used in conjunction with two expressions, to test more than one condition. If both the conditions are true the returns 1. If false then return 0. AND (&): Only used in Bitwise manipulation. It is a unary operator. 8. What is the difference between = and == operator? Where = is an assignment operator and == is a relational operator. Example: while (i=5) is an infinite loop because it is a non zero value and while (i==5) is true only when i=5. 9. What is type casting? Type casting is the process of converting the value of an expression to a particular data type. Example: int x,y; c = (float) x/y; where a and y are defined as integers. Then the result of x/y is converted

into float. 10. What is conversion specification? The conversion specifications are used to accept or display the data using the INPUT/OUTPUT statements. 11. What is the difference between a and a? a is a character constant and a is a string. 12. What is the difference between if and while statement? if while (i) It is a conditional statement (i) It is a loop control statement (ii) If the condition is true, it executes some statements. (ii) Executes the statements within the while block if the condition is true. (iii) If the condition is false then it stops the execution the statements. (iii) If the condition is false the control is transferred to the next statement of the loop. 13. What is the difference between while loop and dowhile loop? In the while loop the condition is first executed. If the condition is true then it executes the body of the loop. When the condition is false it comes of the loop. In the dowhile loop first the statement is executed and then the condition is checked. The dowhile loop will execute at least one time even though the condition is false at the very first time.

14. What is a Modulo Operator? % is modulo operator. It gives the remainder of an integer division Example: a=17, b=6. Then c=%b gives 5. 15. How many bytes are occupied by the int, char, float, long int and double? int - 2 Bytes char - 1 Byte float - 4 Bytes long int - 4 Bytes double - 8 Bytes 16. What are the types of I/O statements available in C? There are two types of I/O statements available in C. Formatted I/O Statements Unformatted I/O Statements 17. What is the difference between ++a and a++? ++a means do the increment before the operation (pre increment) a++ means do the increment after the operation (post increment) Example: a=5; x=a++; /* assign x=5*/ y=a; /*now y assigns y=6*/ x=++a; /*assigns x=7*/ 18. What is a String? String is an array of characters. 19. What is a global variable? The global variable is a variable that is declared outside of all the functions. The

global variable is stored in memory, the default value is zero. Scope of this variable is available in all the functions. Life as long as the programs execution doesnt come to an end. 20. What are the Escape Sequences present in C \n - New Line \b - Backspace \t - Form feed \ - Single quote \\ - Backspace \t - Tab \r - Carriage return \a - Alert \ - Double quotes 21. Construct an infinite loop using while? while (1) {} Here 1 is a non zero, value so the condition is always true. So it is an infinite loop. 22. What will happen when you access the array more than its dimension? When you access the array more than its dimensions some garbage value is stored in the array. 23. Write the limitations of getchar( ) and sacnf( ) functions for reading strings (JAN 2009) getchar( ) To read a single character from stdin, then getchar() is the appropriate. scanf( )

scanf( ) allows to read more than just a single character at a time. 24. What is the difference between scanf() and gets() function? 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. 25. What is a Structure? Structure is a group name in which dissimilar datas are grouped together. 26. What is meant by Control String in Input/Output Statements? Control Statements contains the format code characters, specifies the type of data that the user accessed within the Input/Output statements. 27. What is Union? Union is a group name used to define dissimilar data types. The union occupies only the maximum byte of the data type. If you declare integer and character, then the union occupies only 2 bytes, whereas structure occupies only 3 bytes. 28. What is the output of the programs given below? main() main() {{ float a; float a; int x=6, y=4; int x=6, y=4; a=x\y; a=(float) x\y; printf(Value of a=%f, a); printf(Value of a=%f,a); }} Output: Output: 1. 1.500000 29. Declare the Structure with an example?

struct name {c har name[10]; int age; float salary; } e1, e2; 30. Declare the Union with an example? union name { char name[10]; int age; float salary; } e1, e2; 31. What is the output of the following program when, the name given with spaces? main() { char name[50]; printf(\n name\n); scanf(%s, name); printf(%s,name); } Output: Lachi (It only accepts the data upto the spaces) 32. What is the difference between while(a) and while(!a)? while(a) means while(a!=0) while(!a) means while(a==0)

33. Why we dont use the symbol & symbol, while reading a String through scanf()? The & is not used in scanf() while reading string, because the character variable itself specifies as a base address. Example: name, &name[0] both the declarations are same. 34. What is the difference between static and auto storage classes? Static Auto Storage Initial value Scope Life Memory Zero Local to the block in which the variables is defined Value of the variable persists between different function calls. Memory Garbage value Local to the block in which the variable is defined. The block in which the variable is defined. 35. What is the output of the program? main() increment() {{

increment(); static int i=1; increment(); printf(%d\n,i) increment(); i=i+1; }} OUTPUT: 123 36. Why header files are included in C programming? This section is used to include the function definitions used in the program. Each header file has h extension and include using # include directive at the beginning of a program. 37. List out some of the rules used for C programming. All statements should be written in lower case letters. Upper case letters are only for symbolic constants. Blank spaces may be inserted between the words. This improves the readability of statements. It is a free-form language; we can write statements anywhere between { and }. a = b + c; d = b*c; (or) a = b+c; d = b*c; Opening and closing braces should be balanced. 38. Define delimiters in C. Delimiters Use :; (

) [] {} #, Colon Semicolon Parenthesis Square Bracket Curly Brace Hash Comma Useful for label Terminates Statement Used in expression and functions Used for array declaration Scope of statement Preprocessor directive Variable Separator 39. What do you mean by variables in C? A variable is a data name used for storing a data value. Can be assigned different values at different times during program execution. Can be chosen by programmer in a meaningful way so as to reflect its function in the program. Some examples are: Sum percent_1

class_total 40. List the difference between float and double datatype. S No Float Double Float / Double 1234 Occupies 4 bytes in memory Range : 3.4 e-38 to 3.8e+38 Format Specifier: % f Example : float a; Occupies 8 bytes in memory Range : 1.7 e-308 to 1.7e+308 Format Specifier: % lf Example : double y; There exists long double having a range of 3.4 e -4932 to 3.4 e +4932 and occupies 10 bytes in memory. Example: long double k; 41. Differentiate break and continue statement S No break continue 123 Exits from current block / loop Control passes to next statement Terminates the program Loop takes next iteration Control passes to beginning of loop Never terminates the program 42. List the types of operators.

S No Operators Types Symbolic Representation 12345678 Arithmetic operators Relational operators Logical operators Increment and Decrement operators Assignment operators Bitwise operators Comma operator Conditional operator = , - , * , / and % > , < , == , >=, <= and != && , || and ! ++ and =,+=,-=,*=,/=,^=,;=,&= & , | , ^ , >> , << , and ~ , ?: 43. Distinguish between while..do and do..while statement in C. (JAN 2009) While..DO DO..while (i) Executes the statements within the while block if only the condition is true. (i) Executes the statements within the while block at least once. (ii) The condition is checked at the starting of the loop

(ii) The condition is checked at the end of the loop 44. Compare switch( ) and nestedif statement. S No switch( ) case nested if 1 2 3 4 Test for equality ie., only constant values are applicable. No two case statements in same switch. Character constants are automatically converted to integers. In switch( ) case statement nested if can be used. It can equate relational (or) logical expressions. Same conditions may be repeated for a number of times. Character constants are automatically converted to integers. In nested if statement switch case can be used. 45. Distinguish Increment and Decrement operators. S No Increment ++ Decrement --

1234 Adds one to its operand Equivalent x = x + 1 Either follow or precede operand Example : ++x; x++; Subtracts one from its operand Equivalent x = x - 1 Either follow or precede operand Example : --x; x--; 46. Give the syntax for the for loop statement for (Initialize counter; Test condition; Increment / Decrement) { statements; } Initialization counter sets the loop to an initial value. This statement is executed only once. The test condition is a relational expression that determines the number of iterations desired or it determines when to exit from the loop. The for loop continues to execute as long as conditional test is satisfied. When condition becomes false, the control of program exists the body of the for loop and executes next statement after the body of the loop. The increment / decrement parameter decides how to make changes in the loop.

The body of the loop may contain either a single statement or multiple statements. 47. What is the use of sizeof( ) operator? The sizeof ( ) operator gives the bytes occupied by a variable. No of bytes occupied varies from variable to variable depending upon its data types. Example: int x,y; printf(%d,sizeof(x)); Output: 2 48. What is a loop control statement? Many tasks done with the help of a computer are repetitive in nature. Such tasks can be done with loop control statements. 49. What are global variable in C? This section declares some variables that are used in more than one function. such variable are called as global variables. It should be declared outside all functions. 50. Write a program to swap the values of two variables (without temporary variable). #include <stdio.h> #include <conio.h> void main( ) { int a =5; b = 10; clrscr( );

prinf(Before swapping a = %d b = %d , a , b); a = a + b; B = a b; a = a b; prinf(After swapping a = %d b = %d, a,b); getch( ); } Output: Before swapping a = 5 b = 10 After swapping a = 10 b = 5 51. Write short notes about main ( ) function in C program. (MAY 2009) Every C program must have main ( ) function. All functions in C, has to end with ( ) parenthesis. It is a starting point of all C programs. The program execution starts from the opening brace { and ends with closing brace }, within which executable part of the program exists.

UNIT V FUNCTIONS AND POINTERS 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. 2 MARKS 1. What is meant by Recursive function? If a function calls itself again and again, then that function is called Recursive function.

2. What is an array? An array is a group of similar data types stored under a common name. int a[10]; Here a[10] is an array with 10 values. 3. What is a Pointer? How a variable is declared to the pointer? (MAY 2009) Pointer is a variable which holds the address of another variable. Pointer Declaration: datatype *variable-name; Example: int *x, c=5; x=&a; 4. What are the uses of Pointers? Pointers are used to return more than one value to the function Pointers are more efficient in handling the data in arrays Pointers reduce the length and complexity of the program They increase the execution speed The pointers saves data storage space in memory 5. What is the output of the program? main() junk(int i, int j) {{ int i=5;j=2; i=i*j; junk(i,j); j=i*j; printf(\n %d %d,i,j); } } Output: 1. 2

2. 6. What are * and & operators means? * operator means value at the address & operator means address of 7. What is meant by Preprocessor? Preprocessor is the program, that process our source program before the compilation. 8. How can you return more than one value from a function? A Function returns only one value. By using pointer we can return more than one value. 9. Is it possible to place a return statement anywhere in C program? Yes. The return statement can occur anywhere. 10. What are the main elements of an array declaration? Array name Type and Size 11. List the header files in C language. <stdio.h> contains standard I/O functions <ctype.h> contains character handling functions <stdlib.h> contains general utility functions <string.h> contains string manipulation functions <math.h> contains mathematical functions <time.h> contains time manipulation functions 12. What are the steps involved in program development life cycle? 1. Program Design 2. Program Coding

3. Program Testing & Debugging 13. What are the types of errors occurred in C program? 1. Syntax errors 2. Runtime errors 3. Logical errors 4. Latent errors 14. What is testing? Testing is the process of executing the program with sample or tested data. 15. What are the types of testing? Human testing Computer based testing 16. How do you define enumerated data type? enum mar_status { single,married,widow }; enum mar_status person1,person2; person1=married; Here the person1 is assigned to value zero. 17. What is meant by debugging? Debugging is the process of locating and isolating the errors. 18. Specify any five syntax error messages. Missing semicolon Missing braces Missing quotes Improper comment characters Undeclared variables 19. What are the pre-processor directives?

Macro Inclusion Conditional Inclusion File Inclusion 20. What is dynamic memory allocation? Allocating the memory at run time is called as dynamic memory allocation. 21. What are the various dynamic memory allocation functions? 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. realloac() - Used to modify the size of the previously allocated memory space. 22. What is the deference between declaring a variable and defining a variable? Declaring a variable means describing its type to the compiler but not allocating any space for it. Defining a variable means declaring it and also allocating space to hold the variable. A variable Can also be initialized at the time it is defined. To put it simply, a declaration says to the compiler, Some where in the program there will be a variable with this name, and this is the kind of data Type it is. On the other hand, a definition says, Right here is this variable with this name and This data type. Note that a variable can be declared any number of times, but it must be defied

Exactly once. For this reason, definitions do not belong in header files, where they might get #included into more than one place in a program. 23. Why does n++ execute than n=n+1? The expression n++ requires a single machine instruction such as INR to carry out the increment operation whereas; n+1 requires more instructions to carry out this operation. 24. Why is it necessary to give the size of an array in an array declaration? When an array is declared, the compiler allocates a base address and reserves enough space in the memory for all the elements of the array. The size is required to allocate the required space. Thus, the size must be mentioned. 25. Where in memory are variables stored? Variables can be stored in several places in memory, depending on their lifetime. (1) Variables that are defined outside any function (whether of global or file static scope), and variables that are defined inside a function as static variables, exist for the lifetime of the programs execution. These variables are stored in the data segment. The data segment is a fixed-size area in memory set aside for these variables. (2) Variables that are the arguments functions exist only during the execution of that function. These variables are stored on the stack. The stack is an area of memory that starts out as small and grows automatically up to some predefined limit.

(3) The third area is the one that does not actually store variables but can be used to store data pointed to by variables. Pointer variables that are assigned to the result of a call to the function malloc() contain the address of a dynamically allocated area of memory. This memory is in an area called the heap. 26. What is an heap memory? The heap is another area that starts out as small and grows, but it grows only when the programmer explicitly calls malloc() or other memory allocation functions, such as calloc(). The heap can share a memory segment with either the data segment or the stack, or it can have its own segment, it all depends on the compiler options and operating system. The heap, like the stack, has a limit on how much it can grow, and the same rules apply as to how that limit is determined. 27. What is the difference between an array and pointer? Difference between arrays and pointers are as follows. Array Pointer 1.Array allocates space automatically. 2.It cannot be resized. 3.It cannot be reassigned. 4.Size of(array name) gives the number of bytes occupied by the array. 1.Pointer is explicitly assigned to point to

an allocated space. 2.It can be resized using realloc (). 3.Pointers can be reassigned. 4.Sezeof(pointer name) returns the number of bytes used to store the pointer variable. 27. What is the purpose of the function main()? (MAY 2009) The function main () invokes other functions within it. It is the first function to be called when the program starts execution. Some salient points about main() are as follows: 1. It is the starting function . 2. It returns an int value to the environment that called the program. 3. Recursive call is allowed for main() also. 4. It is a user-defined function. 5. Program exection ends when the closing brace of the function main() is reached. 6. It has two arguments (a) argument count and (b)argument vector (reprensents strings passed.) 7. Any user-defined name can also be used as parameters for main() instead of argc and argv 28. What is dangling pointer? In C, a pointer may be used to hold the address of dynamically allocated memory. After this memory is freed with the free() function, the pointer itself will still contain the address of the released block. This is referred to as a dangling pointer. Using the pointer in

this state is a serious programming error. Pointer should be assigned NULL after freeing memory to avoid this bug. 29. Compare arrays and structures. Comparison of arrays and structures is as follows. Arrays Structures An array is a collection of data items of same data type. Arrays can only be declared. There is no keyword for arrays. An array name represents the address of the starting element. An array cannot have bit fields. A structure is a collection of data items of different data types. Structures can be declared and defined. The deyword for structures is struct. A structrure name is known as tag. It is a shorthand notation of the declaration. A structure may contain bit fields. 30. Compare structures and unions. Structure Union Every member has its own memory. The keyword used is struct. All members occupy separate memory location, hence different interpretations of the same memory location are not possible.

Consumes more space compared to union. All members use the same memory. The keyword used is union. Different interpretations for the same memory location are possible. Conservation of memory is possible. 31. Is it better to use a macro or a function? Macros are more efficient (and faster) than function, because their corresponding code is inserted directly at the point where the macro is called. There is no overhead involved in using a macro like there is in placing a call to a function. However, macros are generally small and cannot handle large, complex coding constructs. In cases where large, complex constructs are to handled, functions are more suited, additionally; macros are expanded inline, which means that the code is replicated for each occurrence of a macro. 32. List the characteristics of Arrays. All elements of an array share the same name, and they are distinguished form one another with help of an element number. Any particular element of an array can be modified separately without disturbing other elements. 33. What are the types of Arrays? 1.One-Dimensional Array 2. Two-Dimensional Array 3. Multi-Dimensional Array 34. What is the use of \0 character?

When declaring character arrays (strings), \0 (NULL) character is automatically added at end. The \0 character acts as an end of character array. 35. Define sscanf() and sprint() functions. The sscanf(): This function allows to read character from a character Array and writes to another array. Similar to scanf(), but instead of reading from standard input, it reads from an array. The sprintf(): This function writes the values of any data type to an array of characters. 36. Define Strings. Strings: The group of characters, digit and symnbols enclosed within quotes is called as Stirng (or) character Arrays. Strings are always terminated with \0 (NULL) character. The compiler automatically adds \0 at the end of the strings. Example: char name[]={C,O,L,L,E,G,E,E,\0}; The character of a string are stored in contiguous memory locations as follows: C O L L E G E \0 1000 1001 1002 1003 1004 1005 1006 1007 37. What is the use of typedef? It is used to create a new data using the existing type. Syntax: typedef data type name; Example: typedef int hours: hours hrs;/* Now, hours can be used as new datatype */

38. What is C functions? Why they are used? A function is a self-contained block (or) a sub-program of one or more statements that performs a special task when called. To perform a task repetitively then it is not necessary to re-write the particular block of the program again and again. The function defined can be used for any number of times to perform the task. 39. Differentiate library functions and User-defined functions. Library Functions User-defined Functions a) Library functions are pre-defined set of functions that are defined in C libraries. b) User can only use the function but cannot change (or) modify this function. a) The User-defined functions are the functions defined by the user according to his/her requirement. b) User can use this type of function. User can also modify this function. 40. What are the steps in writing a function in a program. a) Function Declaration (Prototype declaration): Every user-defined functions has to be declared before the main(). b) Function Callings: The user-defined functions can be called inside any functions like main(), user-defined function, etc.

c) Function Definition: The function definition block is used to define the user-defined functions with statements. 41. What is a use of return Keyword? The return Keyword is used only when a function returns a value. 42. Give the syntax for using user-defined functions in a program. Syntax for using user-defined functions in a program Syntax: function declaration; function definition; main() main() {{ ====== ====== function calling; (or) function calling; ====== ====== }} function definition; 43. Classify the functions based on arguments and return values. Depending on the arguments and return values, functions are classified into four types. a) Function without arguments and return values. b) Function with arguments but without return values. c) Function without arguments but with return values. d) Function with arguments and return values. 44. Distinguish between Call by value Call by reference. Call by value Call by reference. a) In call by value, the value of actual agreements is passed to the formal

arguments and the operation is done on formal arguments. b) Formal arguments values are photocopies of actual arguments values. c) Changes made in formal arguments valued do not affect the actual arguments values. a) In call by reference, the address of actual argurment values is passed to formal argument values. b) Formal arguments values are pointers to the actual argument values. c) Since Address is passed, the changes made in the both arguments values are permanent.

You might also like