Saturday, December 20, 2014

Showing two DIVs side by side

Following the steps given below you will learn to show several divs side by side. 

 Step 01  Create both HTML & CSS file and link them

 Step 02  Add the DIVs inside the <body> and </body> tags
Now add the codes given below inside the <body> and </body> tags of the HTML file.

<div id="main">
<div id="left">Left DIV</div>
<div id="right">Right DIV</div>
</div>

I have used three DIVs above, the first one is the main DIV defined by the id="main" and another two DIVs are inside the main DIV.

 Step 03  Add the CSS codes to the .css file
Add the following CSS codes given below to the  file main.css (or the css file you have created).

#main{
display: -moz-box;
display: -webkit-box;
-moz-box-pack: center;
-webkit-box-pack: center;
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
}

#left{
border: 1px solid #333;
width: 40%;
}

#right{
border: 1px solid #333;
width: 40%;
}

 Step 04  Save the works and check the result
Finally save both of the .html and .css files and open the .html file in a browser. There you will get two boxes positioned side by side.


Code Description


Main DIV
We have to use <div id="main"> and </div> for the main div. The attribute id is used to define this DIV. I have used main as the value but you may use anything you like. That means the line may be <div id="div1">. Even you may use the line <div class="main"> instead of the line <div id="main">.

In the .css file I have used the codes given below to format the main DIV. Look, I have used #main to target the div, but you have to use .main if you use <div class="main"> instead of the line <div id="main">. This is the main difference of using id=" " and class=" " attributes.

#main{
display: -moz-box;
display: -webkit-box;
-moz-box-pack: center;
-webkit-box-pack: center;
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
}

We have to use the lines -moz-box-orient: horizontal; and -webkit-box-orient: horizontal; to show the DIVs horizontally lying inside the main div. You may also use vertical instead of horizontal to show the divs vertically.

Soon I will add a video here so that you all can understand these properly.


Thursday, December 18, 2014

C program to convert time in seconds to hours, minutes & seconds


This C program will convert the time in seconds to hours, minutes and seconds. After running the program, it will ask to provide the time in seconds. Then the time will be converted to hours, minutes and seconds. This program is tested and 100% accurate. Let's try it yourself.
time conversion,converting seconds in hours, minutes and seconds
#include<stdio.h>

main()
{
long sec, minute, hr, t;

printf("Enter time in Seconds: ");
scanf("%ld", &sec);

hr = sec/3600;
t = sec%3600;
minute = t/60;
sec = t%60;

printf("\nTime is %ld hrs %ld mins %ld secs", hr, minute, sec);
}

Program to find simple interest and compound interest

The C program given below is written to find out the simple interest and compound interest of a principle depending on time and rate. This program is tested and 100% accurate. When you will run this program, you will get a message like Enter principle, rate and time: . Then you have to enter the principle first, then rate and finally time. Soon you will get your expected result.
simple interest, compound interest, c program, life of a programmer, c programmer
#include<stdio.h>
#include<math.h>

main()
{
float p, r, t, si, ci;

printf("Enter principle, rate and time: ");
scanf("%f %f %f", &p, &r, &t);

si = (p*r*t)/100;
ci = p*pow((1+r/100), t) -p;

printf("\nSimple interest: %.2f", si);
printf("\nCompound interest: %.2f", ci);
}

Tuesday, December 16, 2014

Linking CSS file to a HTML file


We have to use CSS to beautify a website and to add various types of effects. We may use CSS codes inside the <head> and </head> tags, but it is not the best practice. That's why we need to know how to create a css file and how to link it with the html file.

 Step 01  Link the css file to the html file
Create a simple webpage and inside the <head> and </head> tag add the line <link rel="stylesheet" type="text/css" href="main.css"/>. The text main.css will be replaced by the name of the CSS file.

linking css to html,linking stylesheet,css tutorial

 Step 02  Add two more lines
Add two more lines <h1>Header Tag</h1> and <p>This is a paragraph</h1> inside the <body> and </body> tags. Then save the html file.

 Step 03  Create a CSS file
Create a new document using notepad or any other text editor, type the CSS codes given below in it and save it with .css extension. For example: main.css

h1{
color:crimson;
size:32px;
}

p{
color: #fff;
background-color: #333;
}

After adding the codes, save the document as main.css file.

The above codes will format the text inside of the <h1> and </h1> tags as we have defined. And it will also format the text inside of the <p> and </p> tags.

 Step 04  Check the html file whether it is working or not
Finally open the html file in a browser like Google Chrome, Mozilla Firefox etc. But remember to keep both of the html and css files in the same directory.


Sunday, December 14, 2014

CSS zoom effect on images of a website

We will create a simple webpage consisting of an image, a message and a title only. Basically we will use some CSS codes to create mouseover zoom effect of images.
CSS tutorial,Image Zooming Effect,CSS Zoom Effect

 Step 01  First of all create a simple webpage
We need a website to apply the zoom effect. That's why you need to create webpage, but you may apply on your existing website if you have. However, use the following codes given below and create a simple webpage using notepad.

<!DOCTYPE html>
<html> 
   <head>
      <title>CSS Zoom Effect</title>
   </head> 
   <body>
      <img src="name.jpg" width="300px" height="180px"/>      <h1>Hover the mouse on the image</h1>
   </body> 
</html>

The above codes will create a simple webpage with a title, an image and a message.

Note: You have to replace name.jpg with the name of your image and keep the image in the same directory.

 Step 02  Add the CSS codes to zoom the image
Now we need to add the CSS codes given below inside the <head> and </head> tags. You may also add these CSS codes in your .css file.

<style>
img:hover {
-webkit-transform:scale(1.2);
transform:scale(1.2);
}

img {
-webkit-transition: all 0.7s ease;
transition: all 0.7s ease;
}
</style>

 Step 03  Finally save your work and get the effect
After completing all above steps, now save the webpage once again and open it with a browser. Now hover the mouse on the image, it will zoom in.

Feel free to contact with me if face any problem and leave a comment if you like it.


Saturday, December 13, 2014

C program to find sphere surface area and volume of a sphere


The program given below is a C program that is written to find out the sphere surface area and volume of a sphere. There are rules to find them and we have to use those rules in the program. Let's see the rules...

Area of a Sphere = 4πr2
Volume of a Sphere = (4/3)πr3
sphere,surface of sphere,area of sphere,c program
According to the above rules, we need to know the r (radius) only to find out the area and volume. Because the value of pi (π) is constant (3.1416).

Here,
Area = ?
Volume = ?
π = 3.1416
r = ?

We have to find out the Area and the Volume, the value of π is fixed and we need to know the radius r only. By the second line #define PI 3.1416 the value of PI has defined 3.1416

By the fifth line float r, area, vol; we have to take three float type variables r, area and vol. r will be used to store the radius of the sphere that we will get from the keyboard using the seventh line scanf("%f", &r);

We have to tell the user to input a value by the sixth line printf("Enter radius of the Sphere: ");

The variables area and vol will be used to store the results.

Later, in eighth and ninth line the program will perform mathematical operations according to the rules described above. The eighth line area = 4*PI*r*r; represent the rule Area of a Sphere = 4πr2 and the ninth line vol = (4/3)*PI*r*r*r; represent the rule Volume of a Sphere = (4/3)πr3

By the tenth and eleventh line the result will be displayed. Generally we use %f to display the float type data, but I have used %.2f  to show immediate two digits of the float number.

#include<stdio.h>
#define PI 3.1416

main()
{
float r, area, vol;

printf("Enter radius of the Sphere: ");
scanf("%f", &r);

area = 4*PI*r*r;
vol = (4/3)*PI*r*r*r;

printf("\nThe area is = %.2f",area);
printf("\nThe volume is = %.2f",vol);
}

Friday, December 12, 2014

Design a webpage using a table

Creating a Simple Table

You have to use the codes given below to create a table of two columns and two rows. Step by step we will add more columns and rows to this table and finally we will create a full functional website of several pages. Lets learn how to create a webpage using the codes given below.

<!DOCTYPE html>
<html>

<head>
<title>Learn Website Designing</title>
</head>

<body>
<table align="center" border="1" style="width: 100%;">
<tbody align="center">
<tr><!--codes for the first row-->
<td>A</td><td>B</td>
</tr><!--end of the codes for the first row-->

<tr><!--codes for the second row-->
<td>A1</td><td>B1</td>
</tr><!--end of the codes for the second row-->
</tbody>
</table>
</body>

</html>
Note: The Ash Colored Codes are not important and/or necessary.

Website Designing,Formatting Table,Webpage using Table


You will get a table as showing below.
AB
A1B1

Explanation of the codes

To create a table I have used the <table> tag in the first line. I have used the attributes align="center", border="1" and style="width: 100%;". That's why the table will be placed in the center position, the width of the table will be 100% according to the webpage size and there will be a border of 1px.

I have used align="center" but you may also use align="left" or align="right". The value for the width attribute may be 80% or 700px. You have to use the closing tag </table> for the opening tag <table>.

In the second line I have used <tbody align="center"> so that all the text of the cells stay in the center position. In the first line I have also used the same attribute align="center" but for the table position only. If you want to show the text in the center position then you have to use <tbody align="center">.

Then in the third line I have used the tag <tr> to create a row and then <td></td> to create a cell. Thus I have used <tr><td>A</td><td>B</td></tr> to create a row and two columns inside of the row. <td>A</td> is for the first column and <td>B</td> for the second column. Thus I have created another row with two columns by the codes <tr><td>A1</td><td>B1</td></tr>.


Add an Extra Row and an Extra Column

Now we will add one more column and one more row with the above table. So we have to use the following codes given below in the box.

<tr><!--codes for the first row-->
<td>A</td><td>B</td><td>C</td>
</tr><!--end of the codes for the first row-->

<tr><!--codes for the second row-->
<td>A1</td><td>B1</td><td>C1</td>
</tr><!--end of the codes for the second row-->

<tr><!--newly added codes for the third row-->
<td>A2</td><td>B2</td><td>C2</td>
</tr><!--end of the codes for the third row-->

Now we will get the table given below.
ABC
A1B1C1
A2B2C2

Create a Table of 10 Rows and 6 Columns

Following the above tricks we will now create a new table with six columns and 10 rows. Later we will change it to a general webpage with several buttons, pages etc. Try yourself to create a table as shown below.

ABCDEF
A1B1C1D1E1F1
A2B2C2D2E2F2
A3B3C3D3E3F3
A4B4C4D4E4F4
A5B5C5D5E5F5
A6B6C6D6E6F6
A7B7C7D7E7F7
A8B8C8D8E8F8
A9B9C9D9E9F9

If you fail then you may use the codes given below.
 <table align="center" border="1" style="width: 100%;">
<tbody align="center">
<tr>
<td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td>
</tr>
<tr>
<td>A1</td><td>B1</td><td>C1</td><td>D1</td><td>E1</td><td>F1</td>
</tr>
<tr>
<td>A2</td><td>B2</td><td>C2</td><td>D2</td><td>E2</td><td>F2</td>
</tr>
<tr>
<td>A3</td><td>B3</td><td>C3</td><td>D3</td><td>E3</td><td>F3</td>
</tr>
<tr>
<td>A4</td><td>B4</td><td>C4</td><td>D4</td><td>E4</td><td>F4</td>
</tr>
<tr>
<td>A5</td><td>B5</td><td>C5</td><td>D5</td><td>E5</td><td>F5</td>
</tr>
<tr>
<td>A6</td><td>B6</td><td>C6</td><td>D6</td><td>E6</td><td>F6</td>
</tr>
<tr>
<td>A7</td><td>B7</td><td>C7</td><td>D7</td><td>E7</td><td>F7</td>
</tr>
<tr>
<td>A8</td><td>B8</td><td>C8</td><td>D8</td><td>E8</td><td>F8</td>
</tr>
<tr>
<td>A9</td><td>B9</td><td>C9</td><td>D9</td><td>E9</td><td>F9</td>
</tr>
</tbody></table>

Add <tr></tr> tags to create more rows and used <td></td> tags to create more columns.


Plan for a Webpage

The cells A, B, C, D, E and F will be the banner of the webpage and A1, B1, C1, D1, E1 and F1 will be the menu for the webpages. The other cells A2, B2, C2, D2, E2 and F2 will be used to show the current news or important messages. And the cells A3, A4, A5, A6 and A7 will be used for the side menus. And finally the others cells will the main blank portion of the page where the main content will be shown.

ABCDEF
A1B1C1D1E1F1
A2B2C2D2E2F2
A3B3C3D3E3F3
A4B4C4D4E4F4
A5B5C5D5E5F5
A6B6C6D6E6F6
A7B7C7D7E7F7
A8B8C8D8E8F8
A9B9C9D9E9F9

The table given below is the expected table to turn it to a webpage.
A
A1B1C1D1E1F1
A2
A3B3
A4
A5
A6
A7
A8
A9

The necessary codes for the above table is given below.
<table align="center" border="1" style="width: 100%;">
<tbody align="center">
<tr>
<td colspan="6">A</td>
</tr>
<tr>
<td>A1</td><td>B1</td><td>C1</td><td>D1</td><td>E1</td><td>F1</td>
</tr>
<tr>
<td colspan="6">A2</td>
</tr>
<tr>
<td>A3</td><td colspan="5" rowspan="7">B3</td>
</tr>
<tr>
<td>A4</td>
</tr>
<tr>
<td>A5</td>
</tr>
<tr>
<td>A6</td>
</tr>
<tr>
<td>A7</td>
</tr>
<tr>
<td>A8</td>
</tr>
<tr>
<td>A9</td>
</tr>
</tbody>
</table>

Final Touch for the Webpage

Fairytips  
This website is full of HTML Tutorial. You will also learn more about Website Designing from this site. Just stay with me and learn to design a website easily.
HomeHTMLCSSJAVAPHPAbout Me
Learn HTML
ASP.NETYour Content Here...
MySQL
XML
XHTML
Ads Here
Text Board
More...

The codes for the above table is given below.
<table align="center" border="0" style="width: 100%;">
<tbody>
<tr>
<td align="align" bgcolor="45818e" colspan="6"><blockquote>
<h1>
Fairytips</h1>
This website is full of HTML Tutorial. You will also learn more about Website Designing from this site. Just stay with me and learn to design a website easily.</blockquote>
</td>
</tr>
<tr align="center" bgcolor="45818e">
<td width="15%"><span style="color: #f1f1f1;" onmouseover="menu">Home</span></td>
<td><span style="color: #f1f1f1;">HTML</span></td>
<td><span style="color: #f1f1f1;">CSS</span></td>
<td><span style="color: #f1f1f1;">JAVA</span></td>
<td><span style="color: #f1f1f1;">PHP</span></td>
<td><span class="Apple-style-span" style="color: #f1f1f1;">About Me</span></td>
</tr>
<tr>
<td colspan="6"><marquee>Learn HTML</marquee></td>
</tr>
<tr>
<td align="center" bgcolor="45818e">ASP.NET</td>
<td colspan="5" rowspan="7" valign="top">Your Content Here...</td>
</tr>
<tr>
<td align="center" bgcolor="45818e">MySQL</td>
</tr>
<tr>
<td align="center" bgcolor="45818e">XML</td>
</tr>
<tr>
<td align="center" bgcolor="45818e">XHTML</td>
</tr>
<tr>
<td align="center" bgcolor="45818e">Ads Here </td>
</tr>
<tr>
<td align="center" bgcolor="45818e">Text Board </td>
</tr>
<tr>
<td align="center" bgcolor="45818e">More...</td>
</tr>
</tbody>
</table>

Finally all the codes for the last table is given in the above box. You can create the table using these codes, copy the codes and paste them inside the <body> and </body> tags. Then save the webpage and open it in a web browser.


Thursday, December 11, 2014

How to add favicon to your website


Favicon is an identity for a blog or website, that differ a site from all other. Most of the website owner use their brand logo as Favicon, so that the visitors can identify their site easily when there are few numbers of tabs are open. A blog will be different to look than all others after adding a favicon. Actually favicon is an image, always you will found at the left corner of a blog or website. Lets see how to add it.

 Step 01  Select an image to make favicon
First of all you have to select an image to use as a favicon. The image should be square in dimension and smaller in size. The expected size for the image of favicon is less than 100KB.

>>Lets know how to decrease the image size using Photoshop

 Step 02  Explore the codes of the website
Now open the index.php file with a text editor like notepad, notepad++ etc. Go to the header section and paste the codes given below inside the <head> and </head> tags. The image name favicon.png will be replaced by your image name.

<link rel="icon"  type="image/png" href="favicon.png" />

 Step 03  Now upload / keep the image in the same directory
Now you have to upload and/or keep the favicon image into the same directory where is the index.php file already. Save all changes and reload the homepage, you will get the expected favicon in your website.

Notes...
1. The image should be an PNG image
2. The image should be square in dimension
3. The expected size for the image is less than 100KB
4. The image should be in the same directory
(otherwise you need to customize the image link. For example: href="images/favicon.png")


Tuesday, December 9, 2014

Lets create a Teller Software to narrate your text


Have you ever tried to create a Software using Notepad...? Strange to listen, huh? Yes, you can create a simple software in a minute that will narrate/read the text you will input. It's very simple and funny. 

 Step 01  Open a Notepad Document
Press Windows Key+R together, the RUN Command Box will open. Now type notepad into the box and press thw Enter Key or click on the OK button. After pressing the OK button a new notepad document will open.
You may also open a notepad document following the steps Start>All Programs>Accessories>Notepad.
narrator,primary software,software using notepad

 Step 02  Type the text and save the document with .vbs extension
Now type the text given below into the notepad document. Then click on File from the menu, a drop-down menu will open. Now click on Save As... , a pop-up window will open. Now provide a file name as you want but don't forget to add .vbs extension with that. For example the file name may be speaker.vbs. Finally click on the Save button and save it.

Dim message, sapi
message=InputBox("Say as you like!","Speaker")
Set sapi=CreateObject("sapi.spvoice")
sapi.Speak message



 Step 03  Run the .VBS file and tisten to the text
Now locate the vbs file you have saved just before a while and run the program by double clicking on it. Then a window will open like the image given below. Now write something into the text input box and click on the OK button.


Who is responsible for the greenhouse effect?


Finding out lost data from pendrive


The most common problem we face to use a pendrive is there is nothing in the pendrive. For example: you have stored your project or any other data in a pendrive, but there is nothing when you are going to show that to your teacher and/or boss.

» Then where is the stored data?
» Is the data is still in your pendrive?

First of all, press windows key+E together- the windows explorer will open. Locate your pendrive and make a right click on that, then a pop-up window menu will open. Now click on properties to know how much data is stored there in the pendrive. You will also be able to know if the pendrive is empty.

However, if you think that there is still the data in your pendrive- then follow the steps given below to get back your data.
pen drive problem, data recovery, where is my stored data, lost data, hidden data
 Step 01  Find out Folder and search options and click on it
Press Windows Key+E together to open the explorer window. Then click on Organize from the leftmost top corner, a drop-down menu will open. Then click on Folder and search options as shown in the image below.

To do the same thing in different way click on the Start icon (in windows 7) and type folder option into the search box and simply press the Enter key.
pendrive problem,hidden data,lost data,getting back data
 Step 02  Navigate to View tab and change the settings
After clicking on the Folder and search option, a pop-up window will open as like as the image given below. Now navigate to the View tab, there you will get several options to select or deselect.
 

Now you need to do the followings...
» check the radio button Show hidden files, folders, or drives
» uncheck the boxes
    -Hide empty drives in the Computer folder
    -Hide extensions for known file types
    -Hide protected operating system files (Recommended)

After doing the above the window will look like the image given below.
pendrive, lost data, hidden data
Finally click on the OK button.

 Step 03  Get the data back
Press Windows Key+E if the windows explorer is not opened. Now locate the pendrive and open that again. May be there is nothing yet without some system files. But you will must get an unnamed drive at the top of all. Double click on that to explore, look all of your data is there.

Even if you failed to get your data back and if you sure that you stored the data into the pendrive- then the data may be deleted anyhow. If it happens then recover the lost data now following the first one from the recommended posts.

Recommended posts...
» Recover deleted data easily
» Make a pendrive bootable and install windows using it

Advertisement


Friday, December 5, 2014

The useful codes for Grameenphone

There are some codes for GrameenPhone users to get several services. For example: you may forget the number of your grameen sim, then it is easy to found the phone number by dialing *2# only. If you are grameen phone internet user, then you may know the remaining megabyte (MB) by dialing *566*10# only.
GrameenPhone,USSD Codes,Important Codes,Mobile Numbers
1. Check your GP balance
Dial *566# to check Grameenphone / GP balance

2. Check the remaining Megabyte / MB / GB
Dial *566*10# to check GrameenPhone internet balance

3. Check the Grameen Phone number
Dial *2# to check the gp number you have forgotten

4. To take 10tk loan called emergency balance
Dial *1010*1# to take 10tk loan or emergency balance

5. Activate My Zone to get discount in outgoing calls
Dial *666*1# to activate my zone

6. Deactivate My Zone
Dial *666*9# to deactivate grameen phone my zone

7. To block a caller
Dial *111*1# to block a caller

8. For internet options
Dial *111*6# to go to the internet option


Sunday, November 23, 2014

Create a well-structured webpage using several DIV tags

In the previous posts I have shared the way to create an HTML page and may you also know the basic structure of a simple website. Now in this post I will use some div tags to design a website. Later we will use CSS to customize the divs. The codes are given below is to create a simple webpage only. So use the codes and create a simple webpage first using a text editor like notepade, notepad++ or anyone you prefer.


 Step 01  Create a simple webpage first
First of all you have to create a simple webpage using the codes given below. After creating when you will open the webpage in a web browser then you will get a page as like as the image given below.

Inside the <body> and </body> tags I have written three simple lines inside three different tags. In the next step we will remove all of the codes/text lying inside the <body> and </body> tags. Because our goal is to create a well structured webpage using <div> tags.

<!DOCTYPE html>
<html>
	<head>
		<!--codes to show the title-->
		<title>iDhali</title> 
	</head>
 
	<body>
		<!--header tags-->
		<h1>Hello World!</h1>
		<h2>This is my first webpage</h2>
		<!--parragragh tag-->
		<p>I want to learn website designing completely.</p>
	</body>
</html>

 Step 02  Let's add some <div>s inside the <body> and </body> tags
Now we will add some divs inside the <body> and </body> tags. The divs you need to add are given below.
<div class="wrapper">
	<div class="container">
		<div class="topNav">
		</div>
		<div class="header">
		</div>
		<div class="menu">
		</div>
		<div class="body">
			<div class="contentArea">
			</div>
			<div class="sideBar">
			</div>
		</div>
		<div class="lastAttention">
		</div>
		<div class="footer">
		</div>
	</div>
</div>
 Step 03  Create a CSS file to style the webpage
Now we have to create a new file named style.css/main.css and keep the file into the same directory. Besides we have to link the CSS file to the html file. To do so add the line <link rel="stylesheet" type="text/css" href="main.css"> inside the <head> and </head> tags and save the file index.html

 Step 04  Add some CSS codes
Wait few hours for the next steps. Still editing.... :)

Monday, November 17, 2014

Become a successful freelancer to earn money online

The website www.freelancer.com is so familiar to the freelancers. A large part of the freelancers get different types of jobs from here. But sometimes the beginners find some easy jobs like copy-writing, data entry etc. So they most often bid on those types of jobs. Thus sometimes the beginners involve into captcha typing.

But captcha typing is time killing, so boring and the payment is seriously low. But you should keep patience to get your first job. You should find out the job in which you are skilled and you are interested. Remember there are lots of competitors for a single job and nobody knows you well as you are a beginner.

I think you should chose a subject first, then train up yourself to be a professional. Then try to bid for a job. When you will get your first and you will finish it efficiently, then it will be very easy to get the next jobs.
earn money online,earn money as a freelancer,become a successful freelancer

Steps to become a Successful Freelancer...
1. Select a subject according to your interest
First of all you have to select a subject on which you want to work (for example: website designing). But remember to select a subject according to your interest. You need to be so skilled in your selected subject to get a job. Because there are thousands of competitor for a single job.

2. Train up yourself to be a professional
Then you need to train up yourself as much as you can. Your skill should be as like as a professional. The clients want to work with the skilled and experienced freelancer. So it is tough to be a successful freelancer if you are not skilled.

3. Sign up and complete the profile
Then Sign Up in www.freelancer.com and provide all the information. Upload an attractive photo as your profile photo, so that other can recognize you properly. There are some easy exams, face some of them and complete your profile up to 100%.

4. Bid for jobs you are capable to do
Now you can bid for jobs appearing on your profile. But bit for the jobs you are capable to do. Read all the conditions properly before taking the job.

5. Submit the job in due time
Finally you have to submit the job in due time to the client. Client is the most important person who is giving you jobs and by whom you are earning. So you should always make them happy. Never delay to submit the job. It will be difficult to get your next job if they complain against you.


Friday, November 14, 2014

To convert a upper case letter to lower case


The assembly language program given below is a program for case conversion. The program is capable to convert a uppercase letter to lowercase. For example after running the program, it will ask to provide an uppercase letter. When you will input an uppercase letter using keyboard, then the program will convert the uppercase letter to lowercase immediately. This is the basic operation of the given program.

Objectives
-to learn how to get input from keyboard
-to learn how to input a letter
-to learn how to store a letter into a variable
-to learn how to covert a uppercase letter to lowercase
case conversion program,assembly programming,assembly language,lower level programming
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 0DH
LF EQU 0AH

MSG1 DB 'Enter a upper case letter: $'
MSG2 DB 0DH, 0AH,'In lower case it is: '
CHAR DB ?,'$'

.CODE
MAIN PROC

;initializing ds
MOV AX,@DATA
MOV DS,AX

;print user prompt
LEA DX,MSG1
MOV AH,9
INT 21H

;input a charater and convert to upper case
MOV AH,1
INT 21H
ADD AL,20H
MOV CHAR,AL

;display on the next line
LEA DX,MSG2
MOV AH,9
INT 21H

;dos exit
MOV AH,4CH
INT 21H

MAIN ENDP
END MAIN


To covert a lowercase letter to uppercase letter


Objectives
-to learn how to get input from keyboard
-to learn how to input a letter
-to learn how to store a letter into a variable
-to learn how to covert a lowercase letter to uppercase
case conversion program,assembly language program,low level programming
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 0DH
LF EQU 0AH

MSG1 DB 'Enter a lower case letter: $'
MSG2 DB 0DH, 0AH,'In upper case it is: '
CHAR DB ?,'$'

.CODE
MAIN PROC

;initializing ds
MOV AX,@DATA
MOV DS,AX

;print user prompt
LEA DX,MSG1
MOV AH,9
INT 21H

;input a charater and convert to upper case
MOV AH,1
INT 21H
SUB AL,20H
MOV CHAR,AL

;display on the next line
LEA DX,MSG2
MOV AH,9
INT 21H

;dos exit
MOV AH,4CH
INT 21H

MAIN ENDP
END MAIN


Getting input from keyboard, then showing that as output


Objectives
-to learn how to get input from keyboard
-to learn how to store the data into a variable
-to learn how to show the data from the variable
getting input from keyboard,assembly language programming,primary level programming

.MODEL SMALL
.STACK 100H

.CODE
MAIN PROC

MOV AH,2
MOV DL,'?'
INT 21H

;get the input
MOV AH,1
INT 21H
MOV BL,AL

;carriage return
MOV AH,2
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H

MOV DL,BL
INT 21H

;exit dos
MOV AH,4CH
INT 21H

MAIN ENDP
END MAIN