What is a Subnet Mask?
A subnet mask allows you to identify which part of an IP address is reserved for the network, and which part is available for host use. If you look at the IP address alone, especially now with classless inter-domain routing, you can't tell which part of the address is which. Adding the subnet mask, or netmask, gives you all the information you need to calculate network and host portions of the address with ease. In summary, knowing the subnet mask can allow you to easily calculate whether IP 
Determining network and host portions of an IP address using a subnet mask
To determine what the network 
| IP Address: | 10011100.10011010.01010001.00111000 |
| Subnet mask: | 11111111.11111111.11111111.11110000 |
| Bitwise AND | ----------------------------------------------- |
| Result: | 10011100.10011010.01010001.00110000 |
As you can see, the network address for the IP address and subnet mask in question is 156.154.81.48. To determine the how many hosts are possible to be on this same subnet, it is a simple operation. Count the number of bits from the right until you get to the first "1" in the binary network address display. That number will be the power you raise 2 to for the calculation of possible number of hosts. You must also subtract two from the result because one address is reserved for broadcast and network addresses. This leaves you with the final algorithm of 2^n-2. In this case there are 4 bits of 0 in the network address, leaving you with 2^4-2 hosts possible, or 14 hosts. This means that your network address is 156.54.81.48, that you have a range of addresses available to hosts from 156.154.81.49 - 156.154.81.62, and that the broadcast address for this network is 156.154.81.63.
Are subnet masks necessary?
Subnet masks are critical to communications on an IP network. Network devices use the IP address targets and defined netmask to determine if the network the host is on is a local subnet, or a remote network. This is important because devices act differently depending on the result. If the subnet is local, the device will send an ARP request to retrieve the MAC or hardware address of the system in question to communicate over the data-link layer. If the address is found to be on a remote network, then the network device routes packets to the gateway in it's routing table that is set to handle that network. If no routing table entry is found matching that network, the packets are routed to the default route. If no default route is defined, the packets are dropped with nowhere left to go.
What is Subnetting?
Subnetting is the process of breaking down an IP 
Subnet Mask Notation
There are two forms of subnet notation, standard notation and CIDR (Classless Internet Domain Routing) notation. Both versions of notation use a base address (or network 
In standard subnet mask notation, a four octet numeric value is used as with the base address, for example 255.255.255.0. The standard mask can be calculated by creating four binary values for each octet, and assigning the binary digit of .1. to the network potion, and assigning the binary digit of .0. to the network potion. In the example above this value would be 11111111.11111111.11111111.00000000. In combination with the base address you have a subnet definition, in this case the subnet in standard notation would be 192.168.1.0 255.255.255.0.
In CIDR notation, the number of 1.s in the binary version of the mask are counted from the left, and that number is appended to the end of the base address following a slash (/). In the example here the subnet would be listed in CIDR notation as 192.168.1.0/24.
When is Subnetting Used?
Subnets are created to limit the scope of broadcast traffic, to apply network security measures, to separate network segments by function, and/or to assist in resolving network congestion problems..,
A subnet is usually composed of a network router, a switch or hub, and at least one host
How can I Compute the Maximum Number of Hosts for a Subnet Mask?
To compute the maximum number of hosts for a subnet mask, take two and raise it to the amount of bits allocated to the subnet (count the number of 0.s in the subnet mask binary value) and subtract two. You must subtract two from the resulting value because the first value in the IP address range (all 0s) is reserved for the network address, and the last value in the IP address range (all 1s) is reserved for the network broadcast address. For example, DSL networks commonly use 8 bits for their subnets. The amount of allowable hosts for such a DSL network could be computed by the following formula: max hosts = (2^8)-2 = 254 hosts.
As you subnet networks, the number of bits represented by the subnet mask will decrease. You decrease the octets in order starting from the rightmost value and proceed left as you reach a zero value. Mask values decrease by a power of two each time you split a network into more subnets. Values are 255, 254*, 252, 248, 240, 224, 224, 192, 128. Each decrease indicates that an additional bit has been allocated. After 128, the next bit allocated will reduce the fourth octet to 0; and the third octet will follow same 8-number progression.
For instance, a subnet mask dotted decimal number of 255.255.255.255 indicates that no bits have been allocated and that the maximum number of hosts is 1 (0^1=1). The subnet mask 255.255.255.128 indicates that the maximum number of hosts is 128. And the subnet mask 255.255.128.0 indicates that the maximum number of hosts is 32,786.
* 254 is not a valid number for the fourth octet because no addresses are available for hosts. i.e. (2^1)-2 = 0.
What is a Subnet?
A subnet is a logical organization of network 
Most modern subnet definitions are created according to 3 main factors. These include:
- the number of hosts that needs to exist on the subnet now and in the future;
- the necessary security controls between networks; and
- the performance required for communications between hosts.
Legacy Subnets
Legacy subnets were not flexible because they had predefined limitations on their size and numbers. These were called "classful" networks because each network could be easily identified and placed into a specific class. Shown below is a table containing the original "classful" definitions for IP 
| IP Address Range | CIDR Equivalent | Purpose | RFC | Class | Total # of Addresses |
|---|---|---|---|---|---|
| 0.0.0.0 - 0.255.255.255 | 0.0.0.0/8 | Zero Addresses | 1700 | A | 16,777,216 |
| 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | Private IP addresses | 1918 | A | 16,777,216 |
| 127.0.0.0 - 127.255.255.255 | 127.0.0.0/8 | Localhost Loopback Address | 1700 | A | 16,777,216 |
| 169.254.0.0 - 169.254.255.255 | 169.254.0.0/16 | Zeroconf / APIPA | 3330 | B | 65,536 |
| 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | Private IP addresses | 1918 | B | 1,048,576 |
| 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24 | Documentation and Examples | 3330 | C | 256 |
| 192.88.99.0 - 192.88.99.255 | 192.88.99.0/24 | IPv6 to IPv4 relay Anycast | 3068 | C | 256 |
| 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | Private IP addresses | 1918 | C | 65,536 |
| 198.18.0.0 - 198.19.255.255 | 198.18.0.0/15 | Network Device Benchmark | 2544 | C | 131,072 |
| 224.0.0.0 - 239.255.255.255 | 224.0.0.0/4 | Multicast | 3171 | D | 268,435,456 |
| 240.0.0.0 - 255.255.255.255 | 240.0.0.0/4 | Reserved | 1700 | E | 268,435,456 |
Classless IP Addresses
With the advent of CIDR (Classless Inter-Domain Routing), the "classful" definition of subnet divisions was lifted. Any network address could be defined just as any of the "classful" subnet of the past could be defined. All that is required is enough neighboring address space to cover all the IP addresses needed. Classless addresses also assist in reducing the overall size of the global routing tables on network devices.
What is a Broadcast Address?
A broadcast address is an IP address that you can you to target all systems on a specific subnet instead of single hosts. The broadcast address of any IP address can be calculated by taking the bit compliment of the subnet mask, sometimes referred to as the reverse mask, and then applying it with a bitwise OR calculation to the IP address in question. Some systems which are derived from BSD use zeros-broadcasts instead of ones-broadcasts. This means that when you create a broadcast address, you fill the host area of the IP address while displayed using binary values with zeros instead of ones. Most operating 
Math example
If you have a system with IP address 192.168.12.220 and a network mask of 255.255.255.128, what should the broadcast address for the system be? Remember, to do this calculation, you need to convert all numbers to binary values. For bitwise OR, remember that any two values where at least one value is "1", the result will be "1", otherwise the result is "0".
| IP Address: | 11000000.10101000.00001100.11011100 |
| Reverse Mask: | 00000000.00000000.00000000.01111111 |
| bitwise OR: | ----------------------------------------------- |
| Broadcast: | 11000000.10101000.00001100.11111111 |
Convert the binary value back to octal, and you have your resulting value of 192.168.12.255. You can use the tech-faq.com subnet calculator to assist you in calculating network IP address values.
Setting up a broadcast address
In most cases the broadcast address will be properly set up by modern operating system once you enter the IP address and subnet mask. In some older unix systems that use classful definitions of subnets, the broadcast address is improperly formed, and you will need to change it.
Changing windows systems broadcast addresses

- Log into the windows system with an account with administrator rights.
- Open your registry editor. If you are not knowledgable in using the registry editor for windows, please do not perform these steps. A mistake can make your system unusable.
- Find the registry key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Tcpip\Parameters\Interfaces\[Adapter ID]". Replace [Adapter ID] with the actual adapter ID you want to change the broadcast address for. You can get a list of all the adapter IDs in your windows system by opening a command line prompt, and executing a "ipconfig /all" command.
- Create a new DWORD value called "UseZeroBroadcast". Set its inital value to "1". You can use a hex or binary value in this case, since 1 is the same for both numbering systems.
- Reboot your system for the changes to take effect. You have enabled zeros-broadcast for that adapter.
Changing unix systems broadcast addresses
Unix systems give the administrator a method to change the broadcast address to whatever value that they see fit to change it to. Ensure you know what you are doing before changing your broadcast address. In some cases, when using ifconfig from the command line, the broadcase address gets set to a classful based broadcast instead of the proper broadcast. You can check your results using the "ifconfig" command. Unfortunately, every unix system has differing syntax for the ifconfig command, and not all command options are available for every unix system. Check your ifconfig man page if you get hung up. The sample procedure below is the process you would use on a linux system to change a system broadcast address.
- Open a terminal window, telnet, or ssh into the unix system in question, and log into the system.
- "Su" or "sudo" commands properly to get root priviledges.
- Determine which adapter you want to change the broadcast address on the system by checking the output of "ifconfig -a".
- Execute "ifconfig
broadcast ". Replace and with the proper values. - Test your configuration.
IP Addresses
A unique number consisting of 4 parts separated by dots, e.g. 165.113.245.2 Every machine that is on the Internet has a unique IP number - if a machine does not have an IP number, it is not really on the Internet.
Network and Host ID Fields
The four octets that make up an IP address are conventionally represented by a, b, c, and d respectively. The following table shows how the octets are distributed in classes A, B, and C.
| Class | IP Address | Network ID | Host ID |
|---|---|---|---|
| A | a.b.c.d | a | b.c.d |
| B | a.b.c.d | a.b | c.d |
| C | a.b.c.d | a.b.c | D |
Class A: Class A addresses are specified to networks with large number of total hosts. Class A allows for 126 networks by using the first octet for the network ID. The first bit in this octet, is always set and fixed to zero. And next seven bits in the octet is all set to one, which then complete network ID. The 24 bits in the remaining octets represent the hosts ID, allowing 126 networks and approximately 17 million hosts per network. Class A network number values begin at 1 and end at 127.
Class B: Class B addresses are specified to medium to large sized of networks. Class B allows for 16,384 networks by using the first two octets for the network ID. The two bits in the first octet are always set and fixed to 1 0. The remaining 6 bits, together with the next octet, complete network ID. The 16 bits in the third and fourth octet represent host ID, allowing for approximately 65,000 hosts per network. Class B network number values begin at 128 and end at 191.
Class C: Class C addresses are used in small local area networks (LANs). Class C allows for approximately 2 million networks by using the first three octets for the network ID. In class C address three bits are always set and fixed to 1 1 0. And in the first three octets 21 bits complete the total network ID. The 8 bits of the last octet represent the host ID allowing for 254 hosts per one network. Class C network number values begin at 192 and end at 223.
Class D and E: Classes D and E are not allocated to hosts. Class D addresses are used for multicasting, and class E addresses are not available for general use: they are reserved for future purposes.
| Class | First octet in binary | Range of first octet | Network ID | Host ID | Possible number of networks | Possible number of hosts |
|---|---|---|---|---|---|---|
| A | 0XXXXXXX | 0 - 127 | a | b.c.d | 27 = 128 | 224 - 2 = 16,777,214 |
| B | 10XXXXXX | 128 - 191 | a.b | c.d | 214 = 16,384 | 216 - 2 = 65,534 |
| C | 110XXXXX | 192 - 223 | a.b.c | d | 221 = 2,097,152 | 28 - 2 = 254 |
IBM Interview Pattern
The written test consists of two sections each of 45 minutes duration
Section#1
This is the aptitude section consisting of 45 questions to be attempted in 45 minutes. As is in all the exams, this section is based on the MBA pattern of examination.
Section#2
his is the technical section. There is a separate paper for hardware and software. Candidates have to mention beforehand whether they want to write the software or the hardware paper.This section also carries 45 questions to be completed in 45 minutes.
Interview
There are two rounds of interviews, viz., the technical and and the HR round
Technical and Personal Round for Software Candidates
Mainly subjective questions in C, Operating Systems, DBMS, Data Structures are asked interspersed with some on the candidate's personal background.
.Typical questions in C and Data Structures
1. WAP to interchange 2 variables without using the third one
2. Explain quick sort and merge sort algorithms amn derive the time-constraint relation for these.
3. Explain binary searching, fibonacci search
4. General questions on binary trees, transversals
5. General questions on graphs and their representation.
Typical Questions on Operating Systems
1. Demand paging, page faults, replacement algos, thrashing, etc
2. Paged segmentation and segment paging
In this section, case studies are presented are presented before the candidate to percieve his reaction and his/her communication skills are tested. IBM expects teamwork and teamspirit from the candidates and their answers should reflect this attitude
Typical question is
You are a project manager of a big multinational project. There is a person X, assigned to you who has the best technical skills required for the project, even better than you. But he wishes to be the project manager ,which the management does not permit, due to which he threatens to quit. All others in the group are not as competent. Talk yourself out of this situation pretending that the interviewer is the disgruntled employee and explain the necessary action.
ACCENTURE PAPER ON 31-07-2008
No.of Questions : 20
Duration in Minutes: 20
Assessments by Merit Trac
Directions for Questions 1-3 : Choose the option which will correctly fill the blank.
1) I am writing to enquire _________the possibility of hiring a conference room at the hotel on the 2nd of September.
A) Of
B) About
C) Into
D) After
2) _________ having her lunch, she stood - the tree and waited _______ him.
A) With, below, for
B) After, under, for
C) Inside, further, to
D) About, across, into
3) The microscopic animals are the primary food for larval cod and their decline has meant that fewer fish are making it to adulthood to be caught_________ trawlermen.
A) In
B) Into
C) By
D) With
Directions for Questions 4-6 : Choose the word nearest in meaning to the word in ITALICS from the given options.
4) The jacket is impervious to water.
A) Dirty
B) Pure
C) Impenetrable
D) Favorable
5) Chandan was chagrined with the continuous disruption of the power supply to his home.
A) Delighted
B) Creation
C) Peeved
D) Security
6) The latest ordinance issued by the government has provided the bank with two options.
A) Decision
B) Law
C) Opinion
D) Verdict
Directions for Questions 7-10: Choose the answer option which will correctly fill the blank.
7)_________ great writer is convinced that whatever he says is not an echo or imitation of what others have said.
A) An
B) The
C)A
D) No article required
8) ________ Reserve Bank of India directed banks to closely watch _______spending through International Debit Cards.
A) A,the
B) The, the
C) The, a
D) -\n, the
9) The officer received _____ official letter from _____ Ministry of IT in _____ Central Government.
A) A, the, an
C) An, the, the
B) A, an, the
D) An, an, the
10) You CANNOT send out ______uneducated man into ______ world of technology and expect him to perform.
A) An, an
B) A, an
C ) An, the
D) The, an
Directions for Questions 11-15: Read the passage and answer the questions that follow on the basis of the information provided in the passage. Microprocessor is an electronic computer Central Processing Unit (CPU) made from miniaturized transistors and other circuit elements on a single semiconductor Integrated Circuit (IC). Before the advent of microprocessors, electronic CPUs were made from individual small-scale Integrated Circuits containing the equivalent of only a few transistors. By integrating the processor onto one or a very few large-scale Integrated Circuit packages (containing the equivalent of thousands or millions of discrete transistors), the cost of processor power was greatly reduced. The evolution of microprocessors has been known to follow Moore's Law when it comes to steadily increasing performance over the years.
This law suggests that the complexity of an Integrated Circuit with respect to minimum component cost will double in about 18 months. From humble beginnings as the drivers for calculators, the continued increase in power has led to the dominance of microprocessors over every other form of computer; every system from the largest mainframes to the smallest handheld computers now uses a microprocessor at their core. .As with many advances in technology, the microprocessor was an idea wbose time had come. Three projects arguably delivered a complete microprocessor at about the same time: Intel's 4004, Texas Instruments' TMS1000, and Garrett AiResearch's Central Air Data Computer. . A computer-on-a-chip is a variation of a microprocessor, which combines the microprocessor core (CPU), some memory, and I/O (input/output) lines, all on one chip. The proper meaning of microcomputer is a computer using a (number of) microprocessor(s) as its CPU(s), while the concept of the patent is somewhat more similar to a micro controller.
11) Which of the following descriptions would NOT fit a microprocessor?
A) Electronic computer
B) Central Processing Unit
C) Memory disk
D) A single integrated chip circuit.
12) Select the TRUE statement from the following.
A) Microprocessors and computers on a chip are variations of each other.
B) Integration of processing power on chips has made processing power cheaper.
C) Before microprocessors, CPUs were not made from individual small scale ICs.
D) A microprocessor circuit only has transistors in it.
13) Which of the following was NOT the first to develop a microprocessor?
A) Microsoft
B) Intel
C) Texas Instruments
D) Garret
14) According to the passage, which of these is NOT a use of microprocessors?
A) Drivers for calculators
B) Core for large mainframes
C) Advanced mobile phones
D) Used for small handheld computers
15) "A number of microprocessors at its CPU" is an apt description of a:
A) 11icro-controller
B) Micro-computer
C) Micro-processor
D) Micro-transistor
Directions for Questions 16-20: Read the passage and answer the questions that follow on the basis of the information provided in the passage.
Dynamic Link Libraries Windows provides several files called dynamic link libraries (DLLs) that contain collections of software code that perform common functions such as opening or saving a file. When Windows application wants to use one of those functions or routines, the app sends a message to Windows with the names of the DLL file and the function. This procedure is known as calling a function. One of the most frequently used DLLs is Windows COMMDLG.DLL, which includes among others, the functions to display File Open, File Save, Search, and Print dialog boxes. The application also sends any information the DLL function will need to complete the operation. For example, a program calling the Open File function in COMMDLG.DLL would pass along a file spec, such as *. * or *.DOC, to be displayed in the dialog box's Filename text box.
The application also passes along a specification for the type of information it expects the DLL to return to the application when the DLL's work is done. The application, for example, may expect return information in the form of integers, true/false values, or text. Windows passes the responsibility for program execution to the DLL, along with the parameters and the return information the DLL will need. The specific DLL is loaded into memory, and then executed by the processor. At this point the DLL, rather than the application, runs things. The DLL performs all the operations necessary to communicate with Windows and, through Windows, with the PC's hardware. After the DLL function is complete, the DLL puts the return information into memory, where it can be found by the application, and instructs Windows to remove the DLL routine from memory. The application inspects the return information, which usually tells whether the DLL function was able to execute correctly. If the operation was a success, the application continues from where it left off before issuing the function call. If the operation failed, the application displays an error message.
16) By using DLLs, Windows:
A) Saves processing time
B) Multitasks
C) Shares program code
D) Communicates with PCs hardware
17) To use any routine of a DLL, Windows:
A) Searches and copies it in the application code and executes it
B) Loads the DLL file and searches and executes the routine
C) Loads just the required routine in memory and executes it
D) Searches the location of the routine and instructs the application to execute it
18) Which information does an application need to passto Windows to use a DLL routine?
A) Just the name of the routine
B) Just the name of the DLL, which finds in turn the routine to be executed in return
C) Both the name of the routine as well as DLL and any parameters
D) Name of the DLL, routine, any parameters and type of information to be returned
19) According to the passage, while the DLL routine is executing, the calling application:
A) Waits for the routine to execute
B) Continues with other tasks
C) Helps the DLL routine perform by communicating with Windows and through Windows with the PC's hardware
D) Passes all responsibility of program execution to the DLL and is removed from memory
20) The DLL function after execution returns:
A) The parameters and information into memory, where it can be inspected by the calling application
B) Information into memory, where it can be inspected by the calling application
C) To the calling application the information required by it so that it can inspect it
D) The information required into memory so that DLL can inspect whether the function operation was a success
Section 2 -Analytical Ability
No. of Questions: 20
Duration in Minutes: 20
21) 70 students are required to paint a picture. 52 use green color and some children use red, 38 students use both the colors. How many students use red color?
A) 24
B) 42
C) 56
D)70
22) At an international conference, 100 delegates spoke English, 40 spoke French, and 20 spoke both English and French. How many delegates could speak at least one of these two languages?
A) 110
B) 100
C) 140
D) 120
23) A group of 50 students were required to clear 2 tasks, one in rock-climbing and the other in bridge crossing during an adventure sports expedition. 30 students cleared both the tasks. 37 cleared bridge crossing, 38 students cleared rockclimbing. How many students could not clear any task?
A)0
B)3
C)5
D) 9
24) A dance instructor conducts annual workshops in which he holds sessions for basic learners and trainers. In a particular year, 2000 people attended the workshop. 1500 participated as learners and 800 as trainers. How many participated as only trainers?
A) 200
B) 500
C) 800
D) 1500
25) In a group of 400 readers who read science fiction or literacy works or both, 250 read science fiction and 230 read literacy works. How many read both science fiction and literacy works?
A) 80
B) 160
C) 220
D) 400
26) A man said to a lady, "Your mother's husband's sister is my aunt". How is the lady related to the man?
A) Daughter
B) Grand daughter
C) Mother
D) Sister
27) A man is facing west. He turns 45degree in the clockwise direction and then another 180 degree in the same direction and then 270 degree in the anticlockwise direction. Which direction is he facing now?
A) South
B) North-West
C) West
D) South-West
28) In a row of 60, if Ram is standing at 17th from the first, what is his position from the last?
A) 25
B) 43
C)44
D) 45
29) A man is facing northwest. He turns 90 degrees in the clockwise direction and then 135degrees in the anti-clockwise direction. Which direction is he facing now?
A) East
B) West
C) North
D) South
30) What three letter word best completes the below words? VA - __E S___TER - - _ER
A) STR
B)TER
C) CAT
D) \\FAT
Directions for Questions 31-35: In the following questions mark: 1, if the question can be answered with the help of statement I alone. 2, if the question can be answered with the help of statement II alone. 3, if the question can be answered with the help of both I and II. 4, if the question cannot be answered at all.
31) What is the value of P? I. P and Q are integers II. PQ = 10, P + Q =5
A)l
B)2
C)3
D)4
32) Who got the highest score in the Mathematics examination, among Sumit, Amit and Namit. No two students got the same marks. I. Sumit got more marks than Namit. II. Amit did not get lesser marks than Sumit, who did not get lesser marks than Namit.
A)l
B)2
C)3
D)4
33) How many hours does it take some boys and girls in a camp to put up the tent? I. There are 4 boys and 7 girls. II. A girl can put up the tent in 5 hours and a boy can put up the tent in 3 hours.
A)l
B)2
C)3
D)4
34) If p, q, r, s and t are in an Arithmetic Progression, is r the largest among them? I.t>O II. p, q <> O? I. 2X is an even number. II. 3X is an odd number.
A)l
B)2
C)3
D)4
Directions for Questions 36-40: In the following questions mark: 1, if the question can be answered with the help of statement I alone. 2, if the question can be answered with the help of statement II alone. 3, if the question can be answered with the help of both I and II. 4, if the question cannot be answered at all.
31) What is the value of P? I. P and Q are integers II. PQ = 10, P + Q =5
A)l
B)2
C)3
D)4
32) Who got the highest score in the Mathematics examination, among Sumit, Amit and Namit. No two students got the same marks. I. Sumit got more marks than Namit. II. Amit did not get lesser marks than Sumit, who did not get lesser marks than Namit.
A)l
B)2
C)3
D)4
33) How many hours does it take some boys and girls in a camp to put up the tent? I. There are 4 boys and 7 girls. II. A girl can put up the tent in 5 hours and a boy can put up the tent in 3 hours.
A)l
B)2
C)3
D)4
34) If p, q, r, s and t are in an Arithmetic Progression, is r the largest among them? I.t>O II. p, q <> O? I. 2X is an even number. II. 3X is an odd number.
A)l
B)2
C)3
D)4
Directions for Questions 36-40: In a certain code, the symbol for 0 (zero) is. * and that for 1 is $. The numb.:rs greater than 1 are to be written only by using the two symbols given above. The value of the symbol for 1 doubles itself every time it shifts one place to the left. (For example, 4 is written as $**; and; 3 is written as $$)
36) 11x 17 / 10 + 2 x 5 + 3 / 10 can also be represented as:
A) $*$$*
B) $*$$$
C) $$$*$
D) $**$$
37) 260 can be represented as:
A) $****$**
B) $$*$$$$$
C) $$*$$$$**
D) $*****$**
38) 60 / 17 can also be represented as:
A) $$$*$*** / $$**$$
B) $$$***** / $$**$$
C) $*$$*$** / $$**$$
D) $$*$*$** / $$**$$
39) $***$ can be represented as:
A) $$$ / $* B) $*$**- $$
C) $*$*$- $$
D) $$$***$ - $$
40) 30^2 can be represented as:
A) ($$*$$ ) $*+ $*$*$$*$
B) ($$*$$ ) $* + $$****$
C) ( $$*$$ ) $$ + $*$****
D) ( $$*$$ ) $$ + $*$**$
Section 3 : Attention To Detail
No. of Questions: 11
Duration in Minutes: 11
Directions for Questions 41-48: Follow the directions given below to answer the questions that follow. Your answer for each question below would be: A, if ALL THREE items given in the question are exactly ALIKE. B, if only the FIRST and SECOND items are exactly ALIKE. C, if only the FIRST and THIRD items are exactly ALIKE. D, if only the SECOND and THIRD items are exactly ALIKE. E, if ALL THREE items are DIFFERENT.
41)LLMLLLKLMPUU, LLMLLLKLMPUU, LLMLLLKLMPUU
A) A
B)B
C)C
D)D
E)E
42) 0452-9858762, 0452-9858762, 0452-9858762
A) A
B) B
C) C
D) D
E) E
43) NIINIININN, NIININNINN ,NIINIININN
A) A
B)B
C)C
D)D
E)E
44) 4665.8009291, 4665.7999291, 4665.8009291
A) A
B) B
C)C
D)D
E)E
45)808088080.8080, 808008080.8080, 808088080.8080
A) A
B)B
C)C
D)D
E)E
46) If* standsfor /, / stands for -,+ stands for * and -stands for +, then 9/8*7+5-10=?
A) 13.3
B) 10.8
C) 10.7
D) 11.4
47) If* stands for /, / stands for -,+ stands for * and -stands for +, then 9/15*9+2-9=?
A) 14.7
B) 15.3
C) 14.1
D) 16.2
48) If * stands for /, / stands for -, + stands for * and - stands for +, then which of the following is TRUE?
A) 36/12*4+50-8 =-106
B) 12*8/4+50-8 =45.5
C) 36*4/12+36-8 = 4.7
D) 8*36/4+50-8 = 300
Set: 3648(A) ver-Z.O For: Aecenture IDC
Directions for Questions 49-51: In the following questions, the following letters indicate mathematical operations as indicated below: A: Addition V: Equal to S: Subtraction W: Greater than M: Multiplication X: Less than D: Division Out of the four alternatives given in these questions, only one is coccect according to the above letter symbols. Identify the coccect one.
49) See the options given below
A) 6 S 7 A 2 M 3 W 0 D 7
B) 6 A 7 S 2 M 3 W 0 A 7
C) 6 S 7 M 2 S 3 W 0 M 7
D) 6 M 7 S 2 A 3 X 0 D 7
50) If * stands for -,/ stands for +, + stands for / and -stands for *, then which of the following is TRUE?
A) 16/8*6+90-12 =23.2
B) 8*12/6+90-12 =7.2
C) 16*6/8+16-12 =-4.1
D) 12*16/6+90-12 =8
51) If * stands for -,/ stands for +, + stands for / and -stands for * , then which of the following is TRUE?
A) 16*4/18+16-8 = -10.1
B) 18*8/4+40-8 =-2.8
C) 16/18*4+40-8 =33.2
D) 8*16/4+40-8 =-2
Directions for Questions 52-55: For the post of a manager of a leading call centre -Arkade Inc. - situated in Ludhiana, the following are the criteria the candidate must satisfy: - The candidate should have a Management Degree. - The candidate should have at least 4 years of similar experience at-another call center. - The candidate should be more than 30 years of age as on the 1st of July 2003. - The candidate should have 6 months of international exposure, i.e. should have been posted in a foreign country. If a candidate does not satisfy the 1st condition but has more than 2 years of international experience, then the VP operations, will interview him. If a candidate does not satisfy the 4th condition, then the HR manager will interview him.
52) Shakuntala was selected for a managerial position in an international call center after she passed out from AIM Management Institute. After working for 3 years in the call center, she took a sabbatical. She is 29 years of age as on the date of application. She will be:
A) Interviewed only by the HR
B) Interviewed only by the VP
C) Rejected
D) Data insufficient
53) Rajiv has been working as a Manager in Zephyr Inc. for 4 years now. He is an Engineering graduate from a premier engineering institute. His certificate lists his date of birth as 17/12/1974. He has worked in the hotel industry at the executive level. He is:
A) Give an aptitude test
B) Interviewed by the VP
C) Data insufficient
D) Not considered
54) Soma has 2 years of experience in Welsh Inc. and 2 years of experience in Franc Inc., both leading call centers, as a manager. She has a management degree from a premier management organization. She turned 30 this December (2002). She is a B.Com Graduate from St. Xavier's, Calcutta. If she applies for the post, she will:
A) Be interviewed directly by the VP Operations
B) Not be considered
C) Be interviewed by the HR
D) Have to give an aptitude test
55) Salina has over 4 years of experience in Care Touch, a leading call center, as a manager. She completed her MBA from Ranchi and worked in Singapore for UNO for 2 years before joining Care Touch. She will be:
A) Recruited
B) Rejected
C) Interviewed by dIe VP Operations
D) Data insufficient
Java - Programming
Short Table of Contents:
- Full Table of Contents
- Preface
- Chapter 1: Overview: The Mental Landscape
- Chapter 2: Programming in the Small I: Names and Things
- Chapter 3: Programming in the Small II: Control
- Chapter 4: Programming in the Large I: Subroutines
- Chapter 5: Programming in the Large II: Objects and Classes
- Chapter 6: Introduction to GUI Programming
- Chapter 7: Arrays
- Chapter 8: Correctness and Robustness
- Chapter 9: Linked Data Structures and Recursion
- Chapter 10: Generic Programming and Collection Classes
- Chapter 11: Files and Networking
- Chapter 12: Advanced GUI Programming
- Source Code for All Examples in this Book
- News and Errata
C++ - Programming
| Introduction: | |
|---|---|
| Basics of C++: | |
| Control Structures: | |
| Compound Data Types: | |
| Object Oriented Programming: | |
| Advanced Concepts: | |
| C++ Standard Library: | |
Link To this Tutorial: C++ - Programming | |
C - Programming Syllabus
o About C
o C and UNIX
o This Course
o Dialects of C
+ Common C
+ ANSI C
* A Quick Overview of C
o A Very Simple Program
o A Weight Conversion Program
o Weight Conversion Table Using a Function
o Weight Conversion with a Prompt
o Weight Conversion with Command Line Argument
o Fibonacci Series Using an Array
* Using C with UNIX
o Writing the Program
o Compiling the Program
+ The C Compiler (cc)
+ Make, a Program Builder
+ Improved Type Checking Using Lint
o Running the Program
* Constant and Variable Types
o Variables
o Variable Names
o Global Variables
+ External Variables
o Static Variables
o Constants
o Arrays
* Expressions and Operators
o Assignment Statement
o Arithmetic operators
o Type conversion
o Comparison
o Logical Connectors
o Summary
* Control Statements
o The if else Statement
o The switch Statement
o Loops
o The while Loop
o The do while Loop
o The for Loop
o The break Statement
o The continue Statement
o The goto Statement
* Functions in C
o Scope of Function Variables
o Modifying Function Arguments
o Pointers in C
o Arrays and Pointers
o Recursive Functions
* Input and Output
o The Standard Input Output File
o Character Input / Output
+ getchar
+ putchar
o Formatted Input / Output
+ printf
+ scanf
o Whole Lines of Input and Output
+ gets
+ puts
* Handling Files in C
o UNIX File Redirection
o C File Handling - File Pointers
+ Opening a file pointer using fopen
+ Standard file pointers in UNIX
+ Closing a file using fclose
o Input and Output using file pointers
+ Character Input and Output with Files
+ Formatted Input Output with File Pointers
+ Formatted Input Output with Strings
+ Whole Line Input and Output using File Pointers
o Special Characters
+ NULL, The Null Pointer or Character
+ EOF, The End of File Marker
o Other String Handling Functions
o Conclusion
* Structures in C
o Defining a Structure
o Accessing Members of a Structure
o Structures as Function Arguments
o Further Uses of Structures
* The C Preprocessor
o Using #define to Implement Constants
o Using #define to Create Functional Macros
o Reading in Other Files using #include
o Conditional selection of code using #ifdef
+ Using #ifdef for Different Computer Types
+ Using #ifdef to Temporarily Remove Program Statements
* Programs with Several Files
o Advantages of Using Several Files
o How to Divide a Program between Several Files
o Organisation of Data in each File
o Compiling Multi-File Programs
+ Separate Compilation
o Using make with Multi-File Programs
* UNIX Library Functions
o Finding Information about Library Functions
o Use of Library Functions
o Some Useful Library Functions
* Precedence of C operators
* Special Characters
* Formatted Input and Output Function Types
* Some Recommended Books
* C Language Keywords
* Usable SUN Systems
Link To This Guide : C-Programming
Learn C in just 5 hours.C tutorial
Have you always wanted to master a programming language. Well today if you are glancing at this page you have chosen a language which perhaps without doubt is the most versatile. But to learn C for say basic programmers is a challenge. While the old basic used interpreters C uses compilers and basically is very portable. But let quit all this jibrish and get to the heart of this page. I say you can learn C programming in 3 hours. Well atleast the basics that will help you to build more powerful programs.You say I can't show you C in 5 hours. Well let's test that ...
A simple hello program.(demonstrates the const function in all c programs--the main() function.)
(example-1)
main()
{
puts("hello world guess who is writing a c program");
return(0);
}
That's it. In all c programs there is a main function which is followed by a { and closed by a } after a return()function.It doesn't have to be return(0) but that depends upon the type of c compiler you have. Check your compiler before you start your programming.
You saw above that puts function is used to put a whole sentence on the screen; but are there functions that will put characters on the screen/take characters: Yes and next is a table of what they are and what they do. Read them and the examples that follow.
| getchar() | Gets a single character from the input/keyboard. |
| | |
| putchar() | Puts a single character on the screen. |
| | |
The printf function is a function used to print the output to the screen.printf() needs to know if the output is an integer,real,etc example-2
main()
{
printf(hello);
}
Assuming hello was defined earlier say by #define hello "Hello!" the output is Hello!. But if the output is an integer then %d has to be attatched to the printf statement.
This above can be shown as printf("I am %d years old",12) which will result in the following result:I am 12 years old
The %d tells that an integer is to be placed here.
Now we will look into a function called scanf().This lets you input from the kewyboard and for that input to be taken by the program and processed.Once again it is important to tell scanf() what type of data is being scanned.
Here is an example of a program that demonstrates both scanf and printf in unison.
example-3
main() {
int count;
puts("Please enter a number: ");
scanf("%d", &count);
printf("The number is %d",count);
}
That concludes the first hour of your tutorial.Now this is a list of data type identifiers.
%f=float %c=char %s =s tring %e=inputs number in scientific notation.
As you saw in the first hour of our tutorial c is a language in which you program using functions. Functions are usually identified by the following characteristic:>> functionname() In c the main() function is essential. Think of it as a constant function for all your programs and all other functions can be accessed from the main().Before I show you how we do that let us have an example where we want to pause a program before the screen is changed. This would involve the foll- owing procedure:>> write a main function then use puts function to put statements on the screen like we did in section 1 above and then before the next set of puts statements declare a pause.
This is how it is done:
example-4
main()
{
puts("hello there");
puts("what is your name?")
pause()
puts("It is nice to meet you")
}
pause();
{
int move_on;
printf("press entere to continue");
move_on=getchar();
return(0);
}
This above will pause until a key is pressed on the keyboard. Granted that the above program makes no sense from a practical point of view but I want to show is the use of another function inside the main function.
C has many functions that comes with it. See your compiler manual to see what you have.Now we are going to look at conditions in c programming:>> the if command and do command.
Here is an example of th if command:
example-5
main()
{
float cost,tax,luxury,total;
luxury=0.0;
printf("Enter the cost of the item: ");
scanf("%f", &cost);
tax=cost*0.06;
if(cost>40000.0)
luxury=cost*0.005;
total=cost+tax+luxury;
printf("the total cost is %0.2f",total);
}
This is a simple example of one if statement. Another If statement is the if -else statement. This can be shown as this
example-6
if(cost >40000)
{
luxury=cost*0.005;
printf("The luxury tax is %.2f",luxury);
}
else
{
puts("There is no luxury tax for the items");
luxury=0.0;
}
Now the format a do statement is as follows:
do
{
instruction;
instruction
}
while(condition);
The format for a FOR statement is as follows:
for(initial=value;condition;increment)
instruction;
Now for an example:
example-7
main()
{
int row,column;
puts("\t\tMY Handy multipication table");
for(row=1;tow<=10;row++) { for(column=1;column<=10;column++) printf("%6d", row*column); putchar('\n'); } } The output is a multipication table of 10x10 size. example-8 main() { int temp; float celsius; char repeat; do { printf("Input a temperature:"); scanf("%d", &temp); celsius=(5.0/9.0)*(temp-32); printf(%d degrees F is %6.2f degrees celsius\n",temp, celsius); printf(("do you have another temperature?"); repeat=getchar(); putchar('\n'); } while(repeat=='y'|| repeat=='y'); } This shows you to how to use the do command for conditional programming in c.
Now we are in our 3rd hour.
Now we will concentrate on arrays:
What is a flag?
A flag is an algorithm that informs the program that a certain condition has occured.
example-9
main()
{
int temp;
float celsius;
char repeat;
char flag;
do
{
flag='n";
do
{
if(flag=='n')
printf("Input a valid temperature :");
else
printf("input a valid temperature,stupid:");
scanf("%d",&temp);
flag='y';
}
while (temp<0||temp>100);
celsius=(5.0/9.0)*(temp-32);
printf("%d degrees F is %6.2f degrees celsius\n",temp,celsius);
printf("Do you have another temperature?");
repeat=getchar();
putchar('\n');
}
while (repeat=='y' || repeat=='Y");
}
That was an example of how flags work.
What is the break command?
The break command ends the loop in which it is placed just as if the while condition, or the condition in a for loop becomes false.
How to declare an array?
An array can be defined as follows:
int temp[5]={45,56,12,98,12};
This would mean the following:
temp[0]=45....temp[4]=12
This was a single dimension array with 5 elements of the integer type.If you wanted to depict float variables just use float temp instead of int temp.
Let us now see an example of using an array for two tasks.
main()
{
int temps[31];
int index,total;
float average,celsius;
total=0.0;
for(index=0;index<31;index++) index="0;index<31;index++)" average="total/31.0" index="0;index<31;index++)" celsius="(5.0/9.0)*(temps[index]-32);">
Now I am going to show you how to pass an array. When you pass an array you are actually passing the address of the array.
Example-10
#define count 31
main()
{
int temps[count];
int index;
float celsius;
for(index=0; index< celsius="(5.0/9.0)*(heat[index]-32);">
Now we are in the fourth hour of our tutorial.We are now going to look at 1)comparing strings 2)determining string lengths. 3) combining strings 4)structures.
Comparing 2 strings:>> In c it is not possible to directly compare two strings so a statement like if (string1==string2) is not valid.
Most c libraries contain a function called the strcmp().This is used to compare two strings in the following manner.
if(strcmp(name1,name2)==0)
puts("The names are the same");
else
puts("The names are not the same.");
Determining string length.:>> This is done using the strlen() function.
a simple programming bit showing this function looks like this:
gets(name);
count=strlen(name);
printf("the string %s has %d characters",name,count);
Combining strings:>>We use the function strcpy() an example follows:
Example-11
strcpy(name,"Adam");
strcpy(name1,"and eve");
strcat(name,name1);
puts(name);
The assumption being that adam and eve are two values of the variables name1 and name2. The end result is the combination of the 2 names.
What are structures?
A structure variable is a collection of other variables comprising different types.
What are pointers?
Ponters are variables which refer to the memory locations of other variables.
This is how a structure is defined.
example-12
struct cd
{
char name[20];
char description[40];
char category[12];
float cost;
int number;
};
main()
Notice how the main function comes after the definition of the structure. In the example above the cd was a cd disk and I was writing the definition of a cd collection program.
Now in the fifth hour I will show you how to output your data onto a disk.After all what is the use of the program if you can't save output to a disk.
Inorder to do this we have to use a pointer. The pointer in this case is FILE. The syntax to declare a file is :FILE*file_ponter;
The link between your program, the file and the computer is established with the fopen() function using the syntax shown below:
pointer=fopen("FILENAME","mode");
For example to create a file by the name cd.dat we do the following:
FILE*cdfile;
cdfile=fopen("CD>DAT","w");
If you will be reading from the file above use "r" instead "w" in the
second sentence.
In order to rpint information use the following command:
FILE*cdfile;
cdfile=fopen("PRN","w");
A file is closed by using the fclose() command.Next we will look at an exam ple of reading from a file.
example-13
#include "stdio.h"
main()
{
FILE*fp;
int letter;
if((fp=fopen("MYFILE","r"))==NULL)
{
puts("Cannot oepn the file");
exit();
}
while((letter=fgetc(fp)) !=eof)
printf("%c",letter);
fclose(fp);
}
The eof statement means end of file and this is included in the stdio.h header file which was declared at the start of the example. The stdio.h header file is one of many that comes with your compiler. So check your compiler specifics for other header files which will help perform other functions.
Now that you went through this tutorial you should be in a position to write simple programs and save it to a disk so you can give it your friends or even your boss. In no way the depth of c can be done in 5 hours but the nut and bolts can be learned that fast.Wher e you go from there depends upon your ambitions and hard work.
Send Mail Through Telnet
Welcome to yet another Hacking Truths manual. Although this manual comes after a long break, it is really nice to get back to writing for HT. Anyway, in the past, we have had a number of explanations on how to send forged emails, how to play with the Sendmail daemon, email headers and everything else to do with SMTP (Simple Mail Transfer Protocol) and emails. Although this manual too throws light on related matter, it is however more focused on advanced tips and tricks and other uncommon but extremely useful pieces of information.
Now, we have already learnt how one can, telnet to Port 25 of a mail server and send an email (even a forged email) by simply typing out some SMTP commands. However, for the benefit of beginners and to refresh the memory of experienced but forgetful people, we would quickly be going through the process. I promise to make it as short as possible, at the same time easy to understand.
Port 25 is the Sendmail Port where the SMTP daemon runs. This daemon is infact the daemon handling all the outgoing mails. All email clients send mail by connecting to Port 25 of the mail server and issuing SMTP commands. This process is automated and occurs in the background. However, one could also manually connect (telnet) to Port 25 of a mail server and manually type out the SMTP commands in order to send emails. So the basic outline of the entire process as below. For details regarding the usage of individual commands, simply type the word ‘help’ followed by the command at the Sendmail prompt.
Note: The below sends a mail from ankit@bol.net.in to namitas@bol.net.in by issuing SMTP commands to the mail server: mail.isp.com Responses from the mail sever have a number preceding them while the commands typed by the user do not have any number preceding.
C:\windows>telnet mail.isp.com
220 mail.isp.com ESMTP Sendmail 8.9.1 (1.1.20.3/07Jul00-0916AM) Thu, 7 Dec 2000 17:18:50 +0530 (IST)
helo ankit.com
250-mail.isp.com Hello [203.xx.yyy.91], pleased to meet you
mail from: ankit@bol.net.in
250 ankit@bol.net.in... Sender ok
rcpt to: namitas@bol.net.in
250 namitas@bol.net.in... Recipient ok
data
354 Enter mail, end with "." on a line by itself
This is the part where the body of the message is typed in.
.
250 RAA0000001693 Message accepted for delivery
The headers of the above email as seen by the recipient is as follows:
Return-Path:
Received: from ankit.com by mail.isp.com (8.9.1/1.1.20.3/07Jul00-0916AM)
id RAA0000001693; Thu, 7 Dec 2000 17:19:49 +0530 (IST)
Date: Thu, 7 Dec 2000 17:19:49 +0530 (IST)
From: Ankit Fadia
Message-Id: <200012071149.raa0000001693@mail.isp.com>
X-UIDL: 920156a3b926c5193036933e6d04efd5
This is the part where the body of the message is typed in.
Anyway, now that we have recalled the basic outline of the process of manually sending an email, let us move on with the main subject of this manual.
The Subject Field Un-subjected
Now, ever since I released the manual on sending forged emails (Sending emails using SMTP commands) I have received a number of emails asking me questions like: “How to Specify the Subject of an email sent manually by connecting to Port 25 of a system”. Or “How to Specify CC and BCC recipients when doing the same?” Well, in this section we discuss just that.
Firstly, let us learn how to specify the subject of an email engineered manually by SMTP commands. Well, the process of specifying the Subject remains pretty much similar to the normal process of sending emails manually. Actually all the commands remain the same until we reach the ‘data’ command. After we issue the ‘data’ command, the remote mail server will reply with the below message:
354 Enter mail, end with "." on a line by itself
This server response means that we can start typing the body of our message now. However, it also indirectly specifies that this is the time that we type in the Subject of the email. We can specify the subject of the email as follows:
Subject: Hi
Where ‘subject:’ is the keyword, which tells the mail server that you are ready to type in your subject and ‘Hi’, is the subject of your choice. You can continue with the body of the email by pressing the ‘Enter’ key and typing in the characters. The end with the: ‘ . ‘(Period) and everything else remains the same.
Let us go though the entire process, step by step. Please note that I have inserted comments wherever necessary within brackets. Both the brackets and the characters within the brackets are not a part of the actual commands.
For this example, we need to keep the following pieces of information in mind:
Mail Server: mail.isp.com
Recipient’s Email Address: namitas@bol.net.in
Sender’s Email Address: ankit@bol.net.in
Subject: Hi!!!
Body: This is a test message
C:\windows>telnet mail.isp.com
220 mail.isp.com ESMTP Sendmail 8.9.1 (1.1.20.3/07Jul00-0916AM) Thu, 7 Dec 2000 17:18:50 +0530 (IST)
helo ankit.com
250-mail.isp.com Hello [203.xx.yyy.91], pleased to meet you
mail from: ankit@bol.net.in
250 ankit@bol.net.in... Sender ok
rcpt to: namitas@bol.net.in
250 namitas@bol.net.in... Recipient ok
data
354 Enter mail, end with "." on a line by itself
subject: Hi!!!
This is a test message
.
250 RAA0000001693 Message accepted for delivery
Now if you examine the headers of this email, you will find that they unlike the headers that we viewed earlier in the manual will have a separate Subject line.
Return-Path:
Received: from ankit.com by mail.isp.com (8.9.1/1.1.20.3/07Jul00-0916AM)
id RAA0000001693; Thu, 7 Dec 2000 17:19:49 +0530 (IST)
Date: Thu, 7 Dec 2000 17:19:49 +0530 (IST)
From: Ankit Fadia
Message-Id: <200012071149.raa0000001693@mail.isp.com>
Subject: Hi!!!!
X-UIDL: 920156a3b926c5193036933e6d04efd5
This is a test message
CC’s and BCC’s
What are the SMTP commands equivalent to the BCC and CC fields of your email client? Well, this question has only one simply answer: none. The following few lines will tell us why.
To understand the answer to the above question, let us first understand how exactly does an email client handle a CC or a BCC. How does it do what we are supposed to do with the CC and BCC features?
Now, when you hit the Send button, then your email client connects to Port 25 of the mail server that you specified during the configuration time. Then it will issue SMTP commands to the remote mail server and send it the required information. And in this process your email is sent. The order in which the various SMTP commands are given is same as described earlier.
Normally, when you have only a single recipient, then your email client issues only a single ‘RCPT TO:’ command, to the mail server. However, when there is more than a single recipient, then the email client issues multiple instances of ‘RCPT TO:’ Or in other words, when the CC field of your email client is not empty then multiple RCPT commands are issued.
You see the Simple Mail Transfer Protocol does not provide any special command for CC’ing an email to someone. The entire concept of CC relies on the issue of multiple RCPT commands to the mail server. The same is the case when you have multiple recipients in the ‘To:’ field of the email client. So basically this means that it really doesn’t matter whether you add a recipient’s email address to the CC field or to the ‘To:’ field. The SMTP command issued and the headers created will remain the same.
Let us take a practical example to make it clearer. The recipients’ list for this example is as follows:
To: ankit@bol.net.in; ankitfadia@hotmail.com
CC: ankit_Fadia@hotmail.com ; namitas@bol.net.in
In this case, the following are the commands, which will send a blank email with the subject ‘test’ from the email address: test@bol.net.in to the above list of recipients.
C:\windows>telnet mail.isp.com
220 mail.isp.com ESMTP Sendmail 8.9.1 (1.1.20.3/07Jul00-0916AM) Thu, 7 Dec 2000 17:18:50 +0530 (IST)
helo ankit.com
250-mail.isp.com Hello [203.xx.yyy.91], pleased to meet you
mail from: test@bol.net.in
250 test@bol.net.in... Sender ok
rcpt to: ankit@bol.net.in
250 ankit@bol.net.in... Recipient ok
rcpt to: ankitfadia@hotmail.com
250 ankitfadia@hotmail.com... Recipient ok
rcpt to: ankit_fadia@hotmail.com
250 ankit_Fadia@hotmail.com... Recipient ok
rcpt to: namitas@bol.net.in
250 namitas@bol.net.in... Recipient ok
data
354 Enter mail, end with "." on a line by itself
subject: Test
.
250 RAA0000001693 Message accepted for delivery
Get it? Now, let us move on to as to how BCC works.
Now, in the above case i.e. in the case of CC, the email client used multiple RCPT’s in the same SMTP session to send the same email to multiple recipients. However, in such a case the email any recipient can view the email addresses of all the recipients. The reason behind this privacy invasion is the fact that a single email sent to either a single or multiple recipients has to have the same exact email headers. This means that all recipients in the ‘CC’ and ‘To’ fields of the same email have to have the same email headers. This is due to the fact that the email addresses of all the recipients were given to the mail server during the same SMTP session. All this may sound quite vague and weird. If that is the case, then read the following paragraphs to understand better.
Now, when you CC a single email to multiple recipients (Say 3) then the following procedure takes place:
Email Client Starts Session at remote mail server.
It introduces itself and the sender.
It uses multiple RCPT commands to send the same email to multiple recipients.
The email client disconnects.
As the email addresses of all the recipients are mentioned in the same session at the remote mail server, they constitute the same email headers. Thus all the recipients are able to view the email addresses to which this email was sent.
Now, in a situation, when we BCC the same email to multiple recipients (Say 2) then the following procedure takes place:
Email Client Starts Session at remote mail server.
It introduces itself and the sender.
It uses a single RCPT commands to send the same email to the first email address in the BCC list.
The email client disconnects.
It again starts a new session at the remote server.
It again introduces itself and the sender.
It uses a single RCPT commands to send the same email to the second email address in the BCC list.
The email client disconnects, once again.
In this case, each recipient was sent an email through a unique session at the remote mail server, thus each recipient received unique email headers and the identity of none of the other recipients in the BCC list was not given away.
The above description of the usage of CC and BCC is based on how Outlook Express works. However, actually Sendmail does provide a manner in which the CC recipients can be specified. After giving the DATA command, one can give the CC list by giving the following command:
CC:Recipient List
However, giving the BCC command instead of CC does not produce the desired result.
Sending Attachments through Sendmail
Today, MIME attachments are used to transfer files attached to an email. MIME attachments use Base64 encoding to encode the binary data. Earlier another encoding standard was used, which was called the Uuencode encoding standard. You can send attachments through Sendmail using any of the above methods.
UU-encoding or Unix-to-Unix encoding is an encoding standard, which converts all kinds of files into ASCII for safe transmission over Networks. Files, which are to be sent over networks, are encoded at the sender’s end and decoded at the receiver’s end. This ensures that files (attachments) can be transferred over different kinds of networks, systems routers etc without any loss. However, this method turned out be corruption prone and is thus not the most preferred one.
According to a University, the basic mechanism of UU-encoding is as follows:
The basic scheme is to break groups of 3 eight-bit characters (24 bits) into 4 six-bit characters and then add 32 (a space) to each six-bit character, which maps it into the readily transmittable character. Another way of phrasing this is to say that the encoded 6 bit characters are mapped into the set: `!"#$%&'()*+,-./012356789:;<=>?@ABC...XYZ[\]^_ for transmission over communications lines.
Such encoding increases the file size by about 42%. So, the mechanism of UU-encoding can be concluded as follows:
File is Uuencoded at sender’s end --------------------à File is Uudecoded at the receiver’s end.
All attachments too can be sent over networks in uuencoded form.
You see if you enter the uuencoded code of any file after you have issued the DATA command at the Sendmail prompt, then the recipient will be able to receive the attachment and view it too. Almost all email clients allow Uudecoding. (Even if the email client used by the recipient does not allow Uudecoding then are several utilities, which do it for you.) All files including images, audio files, video files, text files etc can be encoded by the Uuencoding standard to obtain the uuencoded code.
The method by which attachments in the form of their uuencoded form can be sent as attachments is a 2-step process-:
Converting the file to be sent as an attachment into uuencoded form.
Given the uuencoded form to the mail server after the DATA command.
Let, us first tackle the first step:
If you are using a Windows platform, then all you need to perform Uuencoding is WinZip. If you do not already have WinZip, then you could get it from: http://www.winzip.com/
WinZip can easily be used for obtaining the Uuencode of any file. Simply create a new archive containing the file you want to Uuencode and select Action > Uuencode. You could also simply press Shift + U.
WinZip will save the Uuencode form of the .zip file in the form: filename.uue
A typical .uue file (In this case of an image file) would be as follows:
_=_
_=_ Part 001 of 001 of file new.zip
_=_
begin 666 new.zip
M4$L#!!0``@`(`#5S_RCDJL7+;P```'4````'````;F5W+F=I9G/W=+.P3)1G
MX&%8R``"_T$`Q%#\R<+(P,#(H`/B@.0=F-QZ\INZ%.\\$DX(:]"N_76TM7"V
M:6]\T+)755;)-P(C;UB]*)FR+OSYCGV';_HI7
M3Z55KVB;
K````````(`"V@0````!N97
`
end
The first few lines are only comments added by WinZip and are not actually a part of the Uuencoded code. So, simply eliminate everything above the following line:
begin 666 new.zip
This gives you the Uuencode code of the file you want to transmit as an attachment using Sendmail.
********************
HACKING TRUTH: If you are on a Unix platform then getting the Uuencode of a file becomes extremely easy. Simply go to the Unix shell so you can use uuencode on the file you're trying to send. For purposes of this example, let's presume the file you're trying to send is called "myfile.doc".
At the Unix shell prompt, type the command:
uuencode myfile.doc myfile.doc > tempfile.uu
This tells the uuencode command to encode the file "myfile.doc" and store the name "myfile.doc" in the resulting encoded file. The results are then redirected (by the > sign) into another file that you'll place into your mail message later.
DOS versions of this utility are also easily available at various download sites.
********************
Now, once you have encoded the file and obtained the Uuencoded form, then all you need to do is Copy it and Paste it after the DATA command has been issued at the Sendmail prompt. This will send the file as an attachment.
This was the method in which one can send attachment using the Uuencoding standard. I will describe how to send attachments using the new MIME standard in the later version of this manual.
More Sendmail Tips and Tricks
Normally when you connect to the Sendmail Port of a system, then you only have standard SMTP commands available to you. Although they are more than what you will ever need, however, for those of you who like to play with various options, there are also some other commands, which are by default not available to you.
What I am talking about here is ESMTP commands or Extended Mail Transfer Protocol commands. A mail server with ESMTP enabled decides whether these ESMTP commands are available to the client on the basis of how the client introduces itself to it. Now, normally you introduce yourself by giving the below command:
HELO domain
Now, when you introduce yourself using the HELO command, then most mail servers by default make only the SMTP commands available to the client. Now, in order to make sure that even the ESMTP commands are available to you, you need to introduce yourself to the server by the EHLO command. For Example:
ehlo ankit.com
Now, if the mail server you are connected to, has ESMTP enabled, then it will respond by giving a list of ESMTP commands. Something like the below:
220 mail.isp.com ESMTP Sendmail 8.9.1 (1.1.20.3/07Jul00-0916AM) Thu, 7 Dec2000 17:18:50 +0530 (IST)
ehlo ankit.com
250-mail.isp.com Hello [203.xx.yy.91], pleased to meet you
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250-ETRN
250-XUSR
250 HELP
********************
HACKING TRUTH: One way of finding out whether your ISP has ESMTP commands enabled, is to see the daemon banner that comes up, when you telnet to Port 25 of its mail server. The word ‘ESMTP’ tells you that such commands are available. For Example,
220 mail.isp.com ESMTP Sendmail 8.9.1 (1.1.20.3/07Jul00-0916AM) Thu, 7 Dec2000 17:18:50 +0530 (IST)
TELNET TO THESE SERVERS
yahoo.co.in--------->mta117.mail.in.yahoo.com
hotmail------------->mc2.law16.hotmail.com
WRITTEN BY ANKIT FADIA ADDED BY ME
- Making a blog at blogspot
- Blog Setting
- How to backing up template
- How to backing up widgets
- How to changing template
- Make a Post Summary (Read more)
- Blog Comment send to @mail
- Adding search engine to blog
- Making a drop down menu
- Add google talk to blog (1)
- Making a News Paper Style Drop Caps
- Adding Recent Post & Recent Comments
- Adding Yahoo!Massenger icon
- Adding Google talk (2)
- Adding yahoo! Massenger Emoticons (1)
- Fix error "Widget IDs should be unique"
- Making a Table of Content
- Adding shoutbox
- Adding user online tracker
- Adding Statistic & tracker
- Adding digg button to post page
- Upload image to image hosting
- Making a Logo and image button
- Adding Favicon to URL address
- Adding a Clock to blog
- Removing the number of label
