Search Your Topic

config
Anish Sir

Anish Sir

"I am delighted once again to pen the welcome note to the Tosh!Yas Technologies ."

 Call +91 74 88 34 7779  | Email : anishsingh@live.com

Website URL: http://toshiyas.in
Tuesday, 20 February 2018 08:29

Memory management

1. UNIVAC is
A) Universal Automatic Computer
B) Universal Array Computer
C) Unique Automatic Computer
D) Unvalued Automatic Computer

2. The basic operations performed by a computer are
A) Arithmetic operation
B) Logical operation
C) Storage and relative
D) All the above

3. The two major types of computer chips are
A) External memory chip
B) Primary memory chip
C) Microprocessor chip
D) Both b and c

4. Microprocessors as switching devices are for which generation computers
A) First Generation
B) Second Generation
C) Third Generation
D) Fourth Generation

5. What is the main difference between a mainframe and a super computer?
A) Super computer is much larger than mainframe computers
B) Super computers are much smaller than mainframe computers
C) Supercomputers are focused to execute few programs as fast as possible while mainframe uses its power to execute as many programs concurrently
D) Supercomputers are focused to execute as many programs as possible while mainframe uses its power to execute few programs as fast as possible.

6. ASCII and EBCDIC are the popular character coding systems. What does EBCDIC stand for?
A) Extended Binary Coded Decimal Interchange Code
B) Extended Bit Code Decimal Interchange Code
C) Extended Bit Case Decimal Interchange Code
D) Extended Binary Case Decimal Interchange Code

7. The brain of any computer system is
A) ALU
B) Memory
C) CPU
D) Control unit

8. Storage capacity of magnetic disk depends on
A) tracks per inch of surface
B) bits per inch of tracks
C) disk pack in disk surface
D) All of above

9. The two kinds of main memory are:
A) Primary and secondary
B) Random and sequential
C) ROM and RAM
D) All of above

10. A storage area used to store data to a compensate for the difference in speed at which the different units can handle data is
A) Memory
B) Buffer
C) Accumulator
D) Address

11. Computer is free from tiresome and boardoom. We call it
A) Accuracy
B) Reliability
C) Diligence
D) Versatility

12. Integrated Circuits (Ics) are related to which generation of computers?
A) First generation
B) Second generation
C) Third generation
D) Fourth generation

13. CD-ROM is a
A) Semiconductor memory
B) Memory register
C) Magnetic memory
D) None of above

14. A hybrid computer
A) Resembles digital computer
B) Resembles analogue computer
C) Resembles both a digital and analogue computer
D) None of the above

15. Which type of computers uses the 8-bit code called EBCDIC?
A) Minicomputers
B) Microcomputers
C) Mainframe computers
D) Super computer

16. The ALU of a computer responds to the commands coming from
A) Primary memory 
B) Control section
C) External memory
D) Cache memory

17. Chief component of first generation computer was
A) Transistors
B) Vacuum Tubes and Valves
C) Integrated Circuits
D) None of above

18. To produce high quality graphics (hardcopy) in color, you would want to use a/n
A) RGB monitor
B) Plotter
C) Ink-jet printer
D) Laser printer

19. What are the stages in the compilation process?
A) Feasibility study, system design and testing
B) Implementation and documentation
C) Lexical Analysis, syntax analysis, and code generation
D) None of the above

20. Which of the following IC was used in third generation of computers?
A) SSI
B) MSI
C) LSI
D) Both a and b

21. The main electronic component used in first generation computers was
A) Transistors
B) Vacuum Tubes and Valves
C) Integrated Circuits
D) None of above

22. A dumb terminal has
A) an embedded microprocessor
B) extensive memory
C) independent processing capability
D) a keyboard and screen

23. One millisecond is
A) 1 second
B) 10th of a seconds
C) 1000th of a seconds
D) 10000th of a seconds

24. The output quality of a printer is measured by
A) Dot per sq. inch
B) Dot per inch
C) Dots printed per unit time
D) All of the above

25. Which of the following was a special purpose computer?
A) ABC
B) ENIAC
C) EDVAC
D) All of the above

26. What was the computer invented by Attanasoff and Clifford?
A) Mark I
B) ABC
C) Z3
D) None of above

27. Which of the following storage devices can store maximum amount of data?
A) Floppy Disk
B) Hard Disk
C) Compact Disk
D) Magneto Optic Disk

28. Which computer was considered the first electronic computer until 1973 when court invalidated the patent?
A) ENIAC
B) MARK I
C) Z3
D) ABC

29. A physical connection between the microprocessor memory and other parts of the microcomputer is known as
A) Path
B) Address bus
C) Route
D) All of the above

30. High density double sided floppy disks could store _____ of data
A) 1.40 MB
B) 1.44 GB
C) 1.40 GB
D) 1.44 MB

31. A high quality CAD system uses the following for printing drawing and graphs
A) Dot matrix printer
B) Digital plotter
C) Line printer
D) All of the above

32. Which of the following is not an input device?
A) OCR
B) Optical scanners
C) Voice recognition device
D) COM (Computer Output to Microfilm)

33. The accuracy of the floating-point numbers representable in two 16-bit words of a computer is approximately
A) 16 digits
B) 6 digits
C) 9 digits
D) All of above

34. In most of the IBM PCs, the CPU, the device drivers, memory, expansion slots and active components are mounted on a single board. What is the name of the board?
A) Motherboard
B) Daughterboard
C) Bredboard
D) Fatherboard

35. In most IBM PCs, the CPU, the device drives, memory expansion slots and active components are mounted on a single board. What is the name of this board?
A) Motherboard
B) Breadboard
C) Daughter board
D) Grandmother board

36. Magnetic disks are the most popular medium for
A) Direct access
B) Sequential access
C) Both of above
D) None of above

37. A technique used by codes to convert an analog signal into a digital bit stream is known as
A) Pulse code modulation
B) Pulse stretcher
C) Query processing
D) Queue management

38. Regarding a VDU, Which statement is more correct?
A) It is an output device
B) It is an input device
C) It is a peripheral device
D) It is hardware item

39. A modern electronic computer is a machine that is meant for
A) Doing quick mathematical calculations
B) Input, storage, manipulation and outputting of data
C) Electronic data processing
D) Performing repetitive tasks accurately

40. When was vacuum tube invented?
A) 1900
B) 1906
C) 1910
D) 1880

41. Which of the following produces the best quality graphics reproduction?
A) Laser printer
B) Ink jet printer
C) Plotter
D) Dot matrix printer

42. Computers with 80286 microprocessor is 
A) XT computer
B) AT comptuers
C) PS/2 computer
D) None of above

43. An application suitable for sequential processing is
A) Processing of grades
B) Payroll processing
C) Both a and b
D) All of above

44. Which of the following is not processing?
A) arranging
B) manipulating
C) calculating
D) gathering

45. The digital computer was developed primarily in
A) USSR
B) Japan
C) USA
D) UK

46. Software in computer
A) Enhances the capabilities of the hardware machine
B) Increase the speed of central processing unit
C) Both of above
D) None of above

47. Today’s computer giant IBM was earlier known by different name which was changes in 1924. What was that name?
A) Tabulator Machine Co.
B) Computing Tabulating Recording Co.
C) The Tabulator Ltd.
D) International Computer Ltd.

48. Before a disk drive can access any sector record, a computer program has to provide the record’s disk address. What information does this address specify?
A) Track number
B) Sector number
C) Surface number
D) All of above

49. The arranging of data in a logical sequence is called
A) Sorting
B) Classifying
C) Reproducing
D) Summarizing

50. What is the responsibility of the logical unit in the CPU of a computer?
A) To produce result
B) To compare numbers
C) To control flow of information
D) To do math’s works

51. Abacus was the first
A) electronic computer
B) mechanical computer
C) electronic calculator
D) mechanical calculator

52. If in a computer, 16 bits are used to specify address in a RAM, the number of addresses will be
A) 216
B) 65,536
C) 64K
D) Any of the above

53. Instructions and memory address are represented by
A) Character code
B) Binary codes
C) Binary word
D) Parity bit

54. The terminal device that functions as a cash register, computer terminal, and OCR reader is the:
A) Data collection terminal
B) OCR register terminal
C) Video Display terminal
D) POS terminal

55. A set of flip flops integrated together is called ____
A) Counter
B) Adder
C) Register
D) None of the above

56. People often call ______ as the brain of computer system
A) Control Unit
B) Arithmetic Logic Unit
C) Central Processing Unit
D) Storage Unit

57. Which is used for manufacturing chips?
A) Bus
B) Control unit
C) Semiconductors
D) A and b only

58. The value of each bead in heaven is
A) 1
B) 3
C) 5
D) 7

59. The first computer introduced in Nepal was
A) IBM 1400
B) IBM 1401
C) IBM 1402
D) IBM1402

60. Mnemonic a memory trick is used in which of the following language?
A) Machine language
B) Assembly language
C) High level language
D) None of above

61. Instruction in computer languages consists of
A) OPCODE
B) OPERAND
C) Both of above
D) None of above

62. Which generation of computer is still under development
A) Fourth Generation
B) Fifth Generation
C) Sixth Generation
D) Seventh Generation

63. A register organized to allow to move left or right operations is called a ____
A) Counter
B) Loader
C) Adder
D) Shift register

64. Which was the most popular first generation computer?
A) IBM 1650
B) IBM 360
C) IBM 1130
D) IBM 2700

65. Which is considered a direct entry input device?
A) Optical scanner
B) Mouse and digitizer
C) Light pen
D) All of the above

66. A set of information that defines the status of resources allocated to a process is
A) Process control
B) ALU
C) Register Unit
D) Process description

67. Each set of Napier’s bones consisted of ______ rods.
A) 5
B) 9
C) 11
D) 13

68. BCD is
A) Binary Coded Decimal
B) Bit Coded Decimal
C) Binary Coded Digit
D) Bit Coded Digit

69. When was the world’s first laptop computer introduced in the market and by whom?
A) Hewlett-Packard, 1980
B) Epson, 1981
C) Laplink Traveling Software Inc, 1982
D) Tandy Model-200, 1985

70. From which generation operating systems were developed?
A) First
B) Second
C) Third
D) Fourth

71. The first firm to mass-market a microcomputer as a personal computer was
A) IBM
B) Super UNIVAC
C) Radio Shaks
D) Data General Corporation

72. How many address lines are needed to address each machine location in a 2048 x 4 memory chip?
A) 10
B) 11
C) 8
D) 12

73. Properly arranged data is called
A) Field
B) Words
C) Information
D) File

74. A computer consists of
A) A central processing unit
B) A memory
C) Input and output unit
D) All of the above

75. Why are vacuum tubes also called valves?
A) Because they can amplify the weak signals and make them strong
B) Because they can stop or allow the flow of current
C) Both of above
D) None of above

76. John Napier invented Logarithm in
A) 1614
B) 1617
C) 1620
D) None of above

77. An integrated circuit is
A) A complicated circuit
B) An integrating device
C) Much costlier than a single transistor
D) Fabricated on a tiny silicon chip

78. What type of control pins are needed in a microprocessor to regulate traffic on the bus, in order to prevent two devices from trying to use it at the same time?
A) Bus control
B) Interrupts
C) Bus arbitration
D) Status

79. Where as a computer mouse moves over the table surface, the trackball is
A) Stationary
B) Difficult to move
C) Dragged
D) Moved in small steps

80. Which of the following is used as a primary storage device?
A) Magnetic drum
B) Hard Disks
C) Floppy
D) All of above

81. Multi user systems provided cost savings for small business because they use a single processing unit to link several
A) Personal computers
B) Workstations
C) Dumb terminals
D) Mainframes

82. What are the three decisions making operations performed by the ALU of a computer?
A) Grater than
B) Less than
C) Equal to
D) All of the above

83. The word processing task associated with changing the appearance of a document is
A) Editing
B) Writing
C) Formatting
D) All of above

84. Nepal brought a computer for census of 2028 BS. This computer was of
A) first generation
B) second generation
C) third generation
D) fourth generation

85. Algorithm and Flow chart help us to
A) Know the memory capacity
B) Identify the base of a number system
C) Direct the output to a printer
D) Specify the problem completely and clearly

86. Which statement is valid about computer program?
A) It is understood by a computer
B) It is understood by programmer
C) It is understood user
D) Both a & b

87. The difference between memory and storage is that memory is _____ and storage is __
A) Temporary, permanent
B) Permanent, temporary
C) Slow, fast
D) All of above

88. When was Pascaline invented?
A) 1617
B) 1620
C) 1642
D) 1837

89. Which of the following statement is valid?
A) Lady Augusta is the first programmer
B) Ada is the daughter of Lord Byron, a famous English poet
C) ADA is a programming language developed by US Defense
D) All of above

90. A compiler is a translating program which
A) Translates instruction of a high level language into machine language
B) Translates entire source program into machine language program
C) It is not involved in program’s execution
D) All of above

91. What is required when more than one person uses a central computer at the same time?
A) Light pen
B) Mouse
C) Digitizer
D) Terminal

92. Which of the following is the first computer to use Stored Program Concept?
A) UNIVAC
B) ENIAC
C) EDSAC
D) None of above

93. The term gigabyte refers to
A) 1024 bytes
B) 1024 kilobytes
C) 1024 megabytes
D) 1024 gigabyte

94. in which year was UK’s premier computing event called ?The which computer? started?
A) 1980
B) 1985
C) 1986
D) 1987

95. Once you load the suitable program and provide required data, computer does not need human intervention. This feature is known as
A) Accuracy
B) Reliability
C) Versatility
D) Automatic

96. What is a brand?
A) The name of companies that made computers
B) The name of product a company gives to identify its product in market
C) A name of class to indicate all similar products from different companies
D) All of above

97. Machine language is
A) Machine dependent
B) Difficult to program
C) Error prone
D) All of above

98. A byte consists of
A) One bit
B) Four bits
C) Eight bits
D) Sixteen bits

99. Modern Computers are very reliable but they are not
A) Fast
B) Powerful
C) Infallible
D) Cheap

100. What is the date when Babbage conceived Analytical engine
A) 1642
B) 1837
C) 1880
D) 1850

 

 
 

Correct Answers

1-A 2-D 3-D 4-D 5-C 6-A 7-C 8-D 9-C 10-B
11-C 12-C 13-D 14-C 15-C 16-B 17-B 18-B 19-C 20-D
21-B 22-D 23-C 24-A 25-A 26-B 27-B 28-A 29-B 30-D
31-B 32-D 33-B 34-A 35-A 36-C 37-A 38-C 39-B 40-B
41-C 42-B 43-C 44-D 45-C 46-A 47-B 48-D 49-A 50-B
51-D 52-B 53-B 54-D 55-C 56-C 57-C 58-C 59-B 60-B
61-C 62-B 63-D 64-A 65-D 66-D 67-C 68-A 69-B 70-C
71-C 72-B 73-C 74-D 75-B 76-A 77-D 78-C 79-A 80-A
81-C 82-D 83-C 84-B 85-D 86-D 87-A 88-C 89-D 90-D
91-D 92-C 93-C 94-A 95-D 96-B 97-D 98-C 99-C 100-B
Thursday, 08 February 2018 05:03

Classification of Computers | Type of Computer

Computers differ based on their data processing abilities. They are classified according to purpose, data handling and functionality.

According to purpose, computers are either general purpose or specific purpose. General purpose computers are designed to perform a range of tasks. They have the ability to store numerous programs, but lack in speed and efficiency. Specific purpose computers are designed to handle a specific problem or to perform a specific task. A set of instructions is built into the machine. 

According to data handling, computers are analog, digital or hybrid. Analog computers work on the principle of measuring, in which the measurements obtained are translated into data. Modern analog computers usually employ electrical parameters, such as voltages, resistances or currents, to represent the quantities being manipulated. Such computers do not deal directly with the numbers. They measure continuous physical magnitudes. Digital computers are those that operate with information, numerical or otherwise, represented in a digital form. Such computers process data into a digital value (in 0s and 1s). They give the results with more accuracy and at a faster rate. Hybrid computersincorporate the measuring feature of an analog computer and counting feature of a digital computer. For computational purposes, these computers use analog components and for storage, digital memories are used.

According to functionality, Type of computers are classified as : 

Analog Computer 

 An analog computer (spelt analogue in British English) is a form of computer that uses continuous physical phenomena such as electrical, mechanical, or hydraulic quantities to model the problem being solved. 

Digital Computer

 A computer that performs calculations and logical operations with quantities represented as digits, usually in the binary number system

Hybrid Computer (Analog + Digital)

 A combination of computers those are capable of inputting and outputting in both digital and analog signals. A hybrid computer system setup offers a cost effective method of performing complex simulations.

Analog Computer 

 An analog computer (spelt analogue in British English) is a form of computer that uses continuous physical phenomena such as electrical, mechanical, or hydraulic quantities to model the problem being solved. 

Digital Computer

 A computer that performs calculations and logical operations with quantities represented as digits, usually in the binary number system

Hybrid Computer (Analog + Digital)

 A combination of computers those are capable of inputting and outputting in both digital and analog signals. A hybrid computer system setup offers a cost effective method of performing complex     simulations.

On the basis of Size: Type of Computer

Super Computer  

The fastest and most powerful type of computer Supercomputers are very expensive and are employed for specialized applications that require immense amounts of mathematical calculations. For example, weather forecasting requires a supercomputer. Other uses of supercomputers include animated graphics, fluid dynamic calculations, nuclear energy research, and petroleum exploration.

The chief difference between a supercomputer and a mainframe is that a supercomputer channels all its power into executing a few programs as fast as possible, whereas a mainframe uses its power to execute many programs concurrently. 

Mainframe Computer

A very large and expensive computer capable of supporting hundreds, or even thousands, of users simultaneously. In the hierarchy that starts with a simple microprocessor (in watches, for example) at the bottom and moves to supercomputers at the top, mainframes are just below supercomputers. In some ways, mainframes are more powerful than supercomputers because they support more simultaneous programs. But supercomputers can execute a single program faster than a mainframe. 

Mini Computer 

A midsized computer. In size and power, minicomputers lie between workstations and mainframes. In the past decade, the distinction between large minicomputers and small mainframes has blurred, however, as has the distinction between small minicomputers and workstations. But in general, a minicomputer is a multiprocessing system capable of supporting from 4 to about 200 users simultaneously.

Micro Computer or Personal Computer

 Desktop Computer: a personal or micro-mini computer sufficient to fit on a desk.

 Laptop Computer: a portable computer complete with an integrated screen and keyboard. It is generally smaller in size than a desktop computer and larger than a notebook computer.

 Palmtop Computer/Digital Diary /Notebook /PDAs: a hand-sized computer. Palmtops have no keyboard but the screen serves both as an input and output device.

Workstations

A terminal or desktop computer in a network. In this context, workstation is just a generic term for a user's machine (client machine) in contrast to a "server" or "mainframe."

Tuesday, 06 February 2018 07:19

Block Diagram of Computer

computer can process data, pictures, sound and graphics. They can solve highly complicated problems quickly and accurately. A computer as shown in Fig.  performs basically five major computer operations or functions irrespective of their size and make. These 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, and
it controls all operations inside a computer.

We discuss below each of these Computer operation

     Block Diagram of Computer and Explain its Various Components

1. Input: This is the process of entering data and programs in to the computer system. You should know that computer is an electronic machine like any other machine which takes as inputs raw data and performs some processing giving out processed data. Therefore, the input unit takes data from us to the computer in an organized manner for processing. 

2. Storage: The process of saving data and instructions permanently is known as storage. Data has to be fed into the system before the actual processing starts. It is because the processing speed of Central Processing Unit (CPU) is so fast that the data has to be provided to CPU with the same speed. Therefore the data is first stored in the storage unit for faster access and processing. This storage unit or the primary storage of the computer system is designed to do the above functionality. It provides space for storing data and instructions. 

The storage unit performs the following major functions:

All data and instructions are stored here before and after processing.

• Intermediate results of processing are also stored here.

3. Processing: The task of performing operations like arithmetic and logical operations is called processing. The Central Processing Unit (CPU) takes data and instructions from the storage unit and makes all sorts of calculations based on the instructions given and the type of data provided. It is then sent back to the storage unit. 

4. Output: This is the process of producing results from the data for getting useful information. Similarly the output produced by the computer after processing must also be kept somewhere inside the computer before being given to you in human readable form. Again the output is also stored inside the computer for further processing.

5. Control: The manner how instructions are executed and the above operations are performed. Controlling of all operations like input, processing and output are performed by control unit. It takes care of step by step processing of all operations inside the computer.

FUNCTIONAL UNITS 

In order to carry out the operations mentioned in the previous section the computer allocates the task between its various functional units. The computer system is divided into three separate units for its operation. They are

Arithmetic Logical Unit (ALU)  

Logical Unit :After you enter data through the input device it is stored in the primary storage unit. The actual processing of the data and instruction are performed by Arithmetic Logical Unit. The major operations performed by the ALU are addition, subtraction, multiplication, division, logic and comparison. Data is transferred to ALU from storage unit when required. After processing the output is returned back to storage unit for further processing or getting stored.

Control Unit (CU) 

The next component of computer is the Control Unit, which acts like the supervisor seeing that things are done in proper fashion. Control Unit is responsible  for  co ordinating various operations using time signal. The control unit determines the sequence in which computer programs and instructions are executed. Things like processing of programs stored in the main memory, interpretation of the instructions and issuing of signals for other units of the computer to execute them. It also acts as a switch board operator when several users access the computer simultaneously. Thereby it coordinates the activities of computer’s peripheral equipment as they perform the input and output. 

Central Processing Unit (CPU) 

The ALU and the CU of a computer system are jointly known as the central processing unit. You may call CPU as the brain of any computer system. It is just like brain that takes all major decisions, makes all sorts of calculations and directs different parts of the computer functions by activating and controlling the operations.

 
Tuesday, 06 February 2018 05:14

Introduction to Computer

What is Computer : Computer is an electronic device that is designed to work with Information. The term computer is derived from the Latin termcomputare’, this means to calculate or programmable machineComputer can not do anything without a Program. It represents the decimal numbers through a string of binary digits. The Word 'Computer' usually refers to the Center Processor Unit plus Internal memory.

Charles Babbage is called the "Grand Father" of the computer. The First mechanical computer designed by Charles Babbage was called Analytical Engine. It uses read-only memory in the form of punch cards.

Computer is an advanced electronic device that takes raw data as input from the user and processes these data under the control of set of instructions (called program) and gives the result (output) and saves output for the future use. It can process both numerical and non-numerical (arithmetic and logical) calculations.

Computer

Digital Computer Definition

The basic components of a modern digital computer are: Input Device, Output Device, Central Processor Unit (CPU), mass storage device and memory. A Typical modern computer uses LSI Chips.  Four Functions about computer are:

 

Input (Data):

Input is the raw information entered into a computer from the input devices. It is the collection of letters, numbers, images etc. 

Process:  

Process is the operation of data as per given instruction. It is totally internal process of the computer system.

Output:

Output is the processed data given by computer after data processing. Output is also called as Result. We can save these results in the storage devices for the future use.

Computer Classification: By Size and Power

Computers differ based on their data processing abilities. They are classified according to purpose, data handling and functionality.

According to functionality, computers are classified as: 

Analog Computer: A computer that represents numbers by some continuously variable physical quantity, whose variations mimic the properties of some system being modeled.

Personal computer: personal computer is a computer small and low costThe term"personal computer" is used to describe desktop computers (desktops).

Workstation: A terminal or desktop computer in a network. In this context, workstation is just a generic term for a user's machine (client machine) in contrast to a "server" or "mainframe."

Minicomputer: minicomputer isn't very mini. At least, not in the way most of us think of mini. You know how big your personal computer is and its related family.

Mainframe: It refers to the kind of large computer that runs an entire corporation.

Supercomputer: It is the biggest, fastest, and most expensive computers on earth.

Microcomputer: Your personal computer is a microcomputer.

Tuesday, 06 February 2018 04:55

Computer Fundamental

Friday, 02 February 2018 05:04

HTML Tables

Using Tables

  • A table is defined using the <table> element, and contains a number of table cells ( <td>, for “table data” ) which are organized into table rows ( <tr>). The markup (HTML code) for a table is always based on rows, never columns.
  • Table cells which act as column headers or row headers should use the <th> (table header) element.
  • Table cells can be merged using the colspan and rowspan attributes.
  • Tables can be broken into sections using the following elements:
    • <thead> — Table header
    • <tbody> — Table body
    • <tfoot> — Table footer
  • A caption can be added to a table using the <caption> element.
  • You can use <col> and <colgroup> to define table columns for styling. However, there are a number of limitations with this practice.

Table Code Sample: Simple Table

<table>
 <tr>
  <th>Name</th>
  <th>Favorite Color</th>
 </tr>
 <tr>
  <td>Bob</td>
  <td>Yellow</td>
 </tr>
 <tr>
  <td>Michelle</td>
  <td>Purple</td>
 </tr>
</table>
Name Favorite Color
Bob Yellow
Michelle Purple

Table Code Sample: Complex Table

<table>
 <caption>A complex table</caption>
 <thead>
  <tr>
   <th colspan="3">Invoice #123456789</th>
   <th>14 January 2025
  </tr>
  <tr>
   <td colspan="2">
    <strong>Pay to:</strong><br>
    Acme Billing Co.<br>
    123 Main St.<br>
    Cityville, NA 12345
   </td>
   <td colspan="2">
    <strong>Customer:</strong><br>
    John Smith<br>
    321 Willow Way<br>
    Southeast Northwestershire, MA 54321
   </td>
  </tr>
 </thead>
 <tbody>
  <tr>
   <th>Name / Description</th>
   <th>Qty.</th>
   <th>@</th>
   <th>Cost</th>
  </tr>
  <tr>
   <td>Paperclips</td>
   <td>1000</td>
   <td>0.01</td>
   <td>10.00</td>
  </tr>
  <tr>
   <td>Staples (box)</td>
   <td>100</td>
   <td>1.00</td>
   <td>100.00</td>
  </tr>
 </tbody>
 <tfoot>
  <tr>
   <th colspan="3">Subtotal</th>
   <td> 110.00</td>
  </tr>
  <tr>
   <th colspan="2">Tax</th>
   <td> 8% </td>
   <td>8.80</td>
  </tr>
  <tr>
   <th colspan="3">Grand Total</th>
   <td>$ 118.80</td>
  </tr>
 </tfoot>
</table>
A complex table
Invoice #123456789 14 January 2025
Pay to:
Acme Billing Co.
123 Main St.
Cityville, NA 12345
Customer:
John Smith
321 Willow Way
Southeast Northwestershire, MA 54321
Name / Description Qty. @ Cost
Paperclips 1000 0.01 10.00
Staples (box) 100 1.00 100.00
Subtotal 110.00
Tax 8% 8.80
Grand Total $ 118.80

About Table-Based Layout

It was common in the early days of the web to use tables as a layout device. Before the advent of modern standards-based browsers, this was the easiest way to make sure that page elements were arranged properly on the screen.

This design pattern is now considered very bad. It is bad for the user experience, bad for SEO, and bad for developers who have to maintain pages.

However, that doesn’t mean you should avoid tables — tables should be used whenever you need to present information in a tabular format.

 




Friday, 02 February 2018 04:37

HTML

Beginners HTML Tutorials

Our HTML tutorials teach you how to create a personal website or site for your business, without forcing you to learn unnecessary theory. We’ll get you building your new website in minutes, not hours.

Our most popular beginners tutorials include:-

  • HTML tables
  • Links
  • Forms
  • Fonts
  • Images

Intermediate & Advanced Tutorials

We’ve plenty of topics for intermediate and advanced HTML learners, too:-

  • CSS tutorials, to make your HTML page look beautiful
  • Javascript for beginners
  • HTML5: What’s New?
  • Semantic Markup
  • Logical tags

 

Thursday, 21 September 2017 05:56

C -for-Program

Print the first five numbers starting from I together with their squares.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  I;

       Clrscr ( );

       For (i=l; <=5; i++)

       Printf (“\n  Number:  %5d  it’ s  Square:  %5d”, I, i*i);

      getch();

}

OUTPUT:

Number:  1  it’ s  Square:  1

Number:  2  it’ s  Square:  4

Number:  3  it’ s  Square:  9

Number:  4  it’ s  Square:  16

Number:  5  it’ s  Square:  25      

#include<stdio.h>

#include<conio.h>

Valid main ( )

{

        Int  I;

        Clrscr ( ) ;

        For ( i=l; i<=15; i= i+l)

        Printf (“%5d”,i);

        getche ( );

}

OUTPUT:

1 2 3 4 5 6 7 8 9 10 11 12 13 14  15

Write a program to display even numbers from 0 to 14.  Declare the initial counter value before the for loop statement.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

        Int  i=o ;

        Clrscr ( );

        For (i<=15;)

        {

                  Printf (“% 5 d “ , i) ;

                  i+=2;

        }

}

OUTPUT:

O 2 4 6 7 8 10 12 14

Write a program to count numbers between 1 to 100 not divisible by 2, 3, and 5.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

     Int  x, c=0;

     Clrscr ( );

     Printf (“\n  Numbers  from  1  to  100  not  divisible  by  2, 3  &  5 \n \n”);

     For (x=0  ;x<=100 ;x ++)

     {

            If (x%2 !=0   &&  x%3!=0  && x%5!=0)

            {

                Printf (%”%d\t” ,x),

                C++;

            }

     }

     Printf (“\nTotal numbers  :  %d”, c );

}

OUTPUT:

Numbers  from  1  to  100  not  divisible  by 2, 3  &  5

1    7    11    13    17    19    23    29    31    37     37

41   43    47    49    53     59    61    67    71     73

77    79    83    89   91    97

Total  Numbers  :  26

Write a program to display the numbers in increasing and decreasing order using the infinite for loop.    

#include<stdio.h>

#include<conio.h>           

Void main ( )

{

       Int  n, a, b;

       Clrscr ( );

       Printf (“Enter  a  number  :”);

       Scanf (“, &);

       A=b=n;

       Printf (“ (++)  ( - - ) \n”);

       Printf (“============”);

       For (;  ;  (a++, b - - ) )

       {

             Printf (“\n%d\t%d”, a, b);

             If (b==0)

             Break;

       }

}

OUTPUT:

Enter  a  number  :  5

(++)         ( - - )

===========

5    5

6    4

7    3

8    2

9    1

10  0   

create an infinite for loop.  Check each value of the for loop.  If the value is even display it otherwise continue with iterations.  Print Even numbers from 1 to 21.  Use break statement to terminate the program.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  i=l;

       Clrscr ( );

       Printf (“\n \t \t  Table  of  Even  numbers  from  1  to  20”);

       Printf (“\n \t \t  ===== == ==== ======= ==== = == == \n”);

       For (;  ;)

       {

           If (i==21)

           Break;

           else  if (i%2==0)

           {

                 Printf (“%d\t”, i);

                 I++;

                 Continue;

           }

           else

           {

                I++;

                Continue;

           }

    }

    getche ( );

}

OUTPUT:

Table  of  Even  numbers  from  1  to  20

====  ==  ====  =======  ===  =  ==  ==

2  4  6  8  10  12  14  16  18  20   

Calculate the sum of the first five numbers and their squares. Display their results.

Void main ( )

{

        Int  I,  sum=0, sqsum=0;

        Clrscr ( );

        For (i=l; i<-5; ++)

        {

               Sum+-I;

               Sqsum+=i*I;

               Printf (“\n  number:  %5d  it’ s  Square  :  %8d”, I, i*i);

       }

       Printf (“\n===================================”);

       Printf (“\n  The  sum  of  the  five  numbers (1  t0  5)  : -%6d”, sum);

       Printf (“\n  The  sum  of  their  Squares: -%9d”,  sqsum);

       getche ( );

}

OUTPUT:

Number:             1                 it’ s  Square:             1

Number:             2                 it’ s  Square:             4

Number:             3                 it’ s  Square:             9

Number:             4                 it’ s  Square:            16

Number:             5                 it’ s  Square:            25

=========================================

The  sum  of  the  five  numbers (1  t0  5) : -  15

The  sum  of  their  Squares: -  55       

 Write a program to find the number in between 7 and 100 which is exactly divisible by 4 and

If divided by 5 and 6 remainders obtained should be 4.

#include<stdio.h>

#include<conio.h>

#  include  <process . h>

Void main ( )

{

       Int  x;

       Clrscr ( );

       For (x=7;x<100;x++)

       {

              If (x%4==0  &&  x%5==4  &&  x%6==4)

              {

                     Printf (“\n  Number  :  %d”, x);

              }

      }

     getche ( );

}

OUTPUT:

Number  :  64   

Write a program to find the sum of the following series.

/*  1.  1+2+3+ ..n  */

/*  2.  12+22+32+..n2  */

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  sum=0, ssum-0, I, j;

       Clrscr ( );

       Printf (“Enter  Number  :”);

       Scanf (“%d”,  &j);

       Clrscr ( );

       Printf (“  Numbers:”);

       For (i=1; i<=j; i++)

       Printf (“%5d”, i);

       Printf (“\n \nSquares:”);

       For (i=1; i<=j; i++)

       {

            Printf (“%5d”, i*i);

            Sum=sum+I;

            Sum=ssum+i*i;

       }

       Printf (“\n \nSum  of  Numbers  from  1  to  %d  :%d”, j, sum);

       Printf (“\nSum  of  Squares  of  1  to  %d  Numbers  :%d”, j, ssum);

}

OUTPUT:

Enter  Number:  5

Numbers:  1  2  3  4  5

Squares:  1  4  9  16  25

Sum  of  Numbers  from  1  to  5:  15

Sum  of  Squares  of  1  to  5  Numbers:  55 

Write a program to find the perfect squares from 1 to 500.

#include<stdio.h>

#include<conio.h>

# include  <math . h>

Void maid ( )

{

      Int  I, count, x;

      Float  c;

      Clrscr ( );

      Printf (“\n \n”);

      Printf (“  Perfect  squares  from  1  to  500 \n”);

      For (i=1; <=500; i++)

  {

      C=sqrt (i);

       X=floor (c);  /*  For  rounding  up  floor ( )  is  used.  */

       {

              Printf (“\t%5d”, i);

              Coun ++;

      }

  }

  Printf (“\n \n  Total  Perfect  Squares  =5d\n”, conut);

  getch ( );

}

OUTPUT:

1       4      9      16      25   36   49   64   81   121   144

169   196   225    256    289   324    361    400   441

484                             

Total  Perfect  Squares  =  22

Write a program to detect the largest number out of five numbers and display it.

#include<stdio.h>

#include<conio.h>

# include<process . h>

Void main ( )

Exit (0);

{

       Int  a, b, c, e, sum=0, I;

       Clrscr ( );

       Printf (“\nEnter  Five  numbers  :”);

       Scanf (“%d  %d  %d  %d  %d”, &a, &b, &c, &d, &e);

       For (i=sum;  i<=sum; I - -)

       {

             If (i==a  ||  i==b  ||  i==c  ||  i==d  ||  i==e)

             {

                   Printf (“The  Largest  Number  :  %d”, i);

                   Exit (0);

             }

      }

}

OUTPUT:

Enter  Five  number  :  5  2  3  7  3 

The  Largest  Number  :  7        

Write a program to detect the smallest number our of five numbers and display it.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d, e, sum=0, I;

      Clrscr ( );

      Printf (“\nEnter  Five  numbers  :”);

      Scanf (“%d  %d  %d  %d  %d”, &a, &b, &c, &d, &e);

      Sum=a+b+c+d+e;

      For (i=l;  i<=sum; i++)

      {

            If (i==a  ||  i==b  ||  i==c  ||  i==d  ||  i==e)

            {

            Printf (“The  Smallest  Number  :  %d”, i)

            Exit (0);

            }

      }

}

OUTPUT:

Enter  Five  numbers  :  5  2  3  7  3

The Smallest  Number:  2          

Write a program to print the five entered numbers in the ascending order.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d, e, sum-0, I;

      Clrscr ( );

      Printf (“\nEnter  Five  numbers  :”);

      Scanf (“%d  %d  %d  %d  %d” &a, &b, &c, &d, &e);

      Printf (“\n  Numbers  in  ascending  order  :”);

      Sum=a+b+c+d+e;

      For (i=l;  i<=sum; i++)

  {

     If (i==a  ||  i==b  ||  i==c  ||  i==d  ||  i==e)

     {

             Printf (“%3d”, i);

     }

  }

}

OUTPUT:

Enter  Five  numbers  :  5  8  7  4  1

Numbers  in  ascending  order  :  1  4  5  7  8  

Perform multiplication of two integers by using the negative sign.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d=0;

      Clrscr ( );

      Printf (“\n  Enter  two  numbers  :”);

      Scanf (“%d  %d”,  &a, &b);

      For (c=l; c<-b; c++)

      D= (d) – ( - a);

      Printf (“Multiplication  of  %d  *  %d  :%d”, a, b, d);

      getche ( );

}

OUTPUT:

Enter  two  numbers  :  5  5

Multiplication  of  5  *  5  :  25   

 Calculate the sum and average of five subjects.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d, e, sum=0, I;

      Float  avg;

      Clrscr ( );

      Printf (“\nEnter  The  Marks  of  Five  Subjects”);

      For (i=l; i<=5; i++)

      {

           Printf (“\n [%d]  Student:”, i);

           If (scanf (“%d  %d  %d  %d  %d”, &a, &b, &c, &d, &e) ==5)

           {

                 Sum=a+b+c+d+e;

                 Avg=sum/5;

                 Printf (“\n  Total  Marks  of  Student [%d]  %d”, I, sum);

                 Printf (“\n  Average  Marks  of  Student [%d]  %f\n”, I, avg);

           }

           else

           {

                Clrscr ( );

                Printf (“\n  Type  Mismatcch”);

           }

     }

}

OUTPUT:

Enter  The  Marks  of  Five  Subjects

[1] Student:  58  52  52  56  78

      Total  Marks  of  Student [1]  296

      Average  Marks  of  Student [1]  59.000000

[2] Student:             

Write a program to find perfect cubes up to a given number.

/* 1, 8, 27, 64 are perfect cubes of 1, 2, 3 and 4 */.

#include<stdio.h>

#include<conio.h>

#  include<math . h>

Void main ( )

{

      Int  I,  j,  k;

      Clrscr ( );

      Printf (“Enter  a  Number  :”);

      Scanf (“%d”, &k);

      For (i=l; i<k; i++)

      {

            For (j=l; j<=I; j++)

            {

                 If (i==pow (j,3) )

                 Printf (“\nNumber  :  %d  &   it’ s  Cube  :%d:, j, i);

            }

     }

}

OUTPUT:

Enter  a  Number  :  100

Number  :  1  &  it’ s  Cube  :  1

Number  :  2  &  it’ s  Cube  :  8

Number  :  3  &  it’ s  Cube  :  27

Number  :  4  &  it’ s  Cube  :  64

Write a program to display the stars as shown below.

*

*  *

*  *  *

*  *  *  *

*  *  *  *  *

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  x, I, j;

       Clrscr ( );

       Printf (“How  many  lines  stars  (*)  should  be  printed  ?  :”);

       Scanf (“%d”, &x);

       For (i=l; i<=x; i++)

       {

              For (j=l; j<=I; j++)

              {

                     Printf (“*”);

              }

              Printf (“\n”);

       }

}

OUTPUT:

How  many  lines  stars  (*)  should  be  printed  ?  :  5

*

*  *

*  *  *

*  *  *  *

*  *  *  *  *

Write a program to generate the pattern of numbers as given under.

6  5  4  3  2  1  0 

5  4  3  2  1  0

4  3  2  1  0

3  2  1  0 

2  1  0 

1  0 

0

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  I, c=0;

      Clrscr ( );

      Printf (“Enter  a  Number  :”);

      Scanf (“%d, &i);

      For (;i>=0i - -)

      {

            C=I;

            Printf (“\n”);

            For (;  ;)

            {

                   Printf (“%3d”, c);

                   If (c==0)

                   Break;

                   C- -;

            }

      }

}

OUTPUT:

Enter  a  number:  6

6  5  4  3  2  1  0 

5  4  3  2  1  0

4  3  2  1  0

3  2  1  0 

2  1  0 

1  0 

Write a program to display the series of numbers as given below.

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  I, j, x; 

      Printf (“\nEnter  Value  of  x  :”);

      Scanf (“%d”,&x);

      Clrscr ( );

      For (j=l; j<=x; j++)

      {

             For (i=l; i<=j; i++)

             Printf (“%3d”, i);

             Printf (“\n”);

     }

     Printf (“\n”);

     For (j=x; j>=l; I - -)

     {

            For (i=j; i>=l; I- -)

            Printf (“%3d”, i);

            Printf (“\n”);

     }

OUTPUT:

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1        

Write a program to display the series of numbers as given below.

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1

#include<stdio.h>

#include<conio.h>

Void main ( )

{

     Int  I, j, x;

     Printf (“\nEnter  Value  of  x  :”);

     Scanf (“%d”, &x);

     Clrscr ( );

     For (j-l; j<=x; j++)

     {

           For (i=j; i>=l; I - -)

           {

                 Printf (“%3d”, i);

           }

           Printf (“\n”);

     }

}

OUTPUT:

Enter  Value  of  x  :  4

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1

Write a program to generate the pyramid structure using numerical.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  k, I, j, x, p=34;

      Printf (“\n  Enter  A  number  :”);

      Scanf (“%d”, &x);

      Clrscr ( );

      For (j=0; j <=x; j++)

      {

             Gotoxy(p, j+l);

             /*  position  cursor  on  screen  (x  cordinate, y  cordinate)  */

            For (i=0 – j; I <=j; i++)

            Printf (“%3d”, abs ( I ) );

            P=p-3;

     }

}

OUTPUT:

Enter  a  number  :  3

            0

        1  0  1

    2  1  0  1  2

3  2  1  0  1  2  3    

 

Tuesday, 19 September 2017 05:11

nested loops in C

C programming allows to use one loop inside another loop. The following section shows a few examples to illustrate the concept.

Syntax

The syntax for a nested for loop statement in C is as follows −

for ( init; condition; increment ) {

   for ( init; condition; increment ) {
      statement(s);
   }
	
   statement(s);
}

The syntax for a nested while loop statement in C programming language is as follows −

while(condition) {

   while(condition) {
      statement(s);
   }
	
   statement(s);
}

The syntax for a nested do...while loop statement in C programming language is as follows −

do {

   statement(s);
	
   do {
      statement(s);
   }while( condition );

}while( condition );

A final note on loop nesting is that you can put any type of loop inside any other type of loop. For example, a 'for' loop can be inside a 'while' loop or vice versa.

Example

The following program uses a nested for loop to find the prime numbers from 2 to 100 −

#include <stdio.h>
 
int main () {

   /* local variable definition */
   int i, j;
   
   for(i = 2; i<100; i++) {

      for(j = 2; j <= (i/j); j++) 
      if(!(i%j)) break; // if factor found, not prime
      if(j > (i/j)) printf("%d is prime", i);
   }
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −

2 is prime
3 is prime
5 is prime
7 is prime
11 is prime
13 is prime
17 is prime
19 is prime
23 is prime
29 is prime
31 is prime
37 is prime
41 is prime
43 is prime
47 is prime
53 is prime
59 is prime
61 is prime
67 is prime
71 is prime
73 is prime
79 is prime
83 is prime
89 is prime
97 is prime
Page 1 of 32