Friday, January 27, 2017

Saturday, January 21, 2017

Top 10 QB problems & solotions

Some importance QBASIC programs

1) Wap to check whether a number is armstrong or not.

INPUT “NUMBER”;N
A=N
DO
R=N MOD 10
SUM=SUM + r^3
N=N10
LOOP WHILE N>0
IF SUM=A THEN
PRINT “ARMSTRONG”
ELSE
PRINT “NOT ARMSTRONG”
END IF
END

 2) Wap to display reverse form of a input word.

 INPUT “ENTER WORD”;A$
FOR I=LEN(A$) TO 1 STEP -1
B$=MID$(A$,1,I)
C$=C$+B$
NEXT I
PRINT C$

 3. Wap to check whether a number is palindrome of not.

INPUT ‘NUMBER’;N
A=N
DO
R= N MOD 10
SUM=SUM*10+R
N=N10
LOOP WHILE N<>0
IF A=SUM THEN
PRINT “PALINDROME”
ELSE
PRINT “NOT PALINDROME”
END IF
END


4. Wap to print only the vowels for a given word.

CLS
INPUT “ENTER WORD”;A$
FOR I= 1 TO LEN(A$)
B$=MID$(A#,I,1)
C$=UCASE$(B$)
IF C$= “A” OR C$= “E” OR C$= “I” OR C$= “O” OR C$= “U” THEN
PRINT C$
END IF
NEXT I
END


5. Wap to ask 2 numbers and find H.C.F. and L.C.M. of given number.

CLS
INPUT A
INPUT B
IF A>B THEN SWAP A,B
FOR I=1 TO A
R= A MOD I
R1= B MOD I
IF R=0 AND R1=0 THEN
H=I
END IF
NEXT I
L=(A*B)/H
PRINT “H.C.F.”;H
PRINT “L.C.M”;L
END


6. Wap to check whether the first character of the word is capital, small or numerical.

CLS
INPUT “ENTER ANY WORD”;N$
A$=LEFT$(N$,1)
A=ASC(A$)
SELECT CASE A
CASE 48 TO 57
PRINT “NUMBER”
CASE 65 TO 90
PRINT “UPPER CASE”
CASE 97 TO 122
PRINT “LOWER CASE”
CASE ELSE
PRINT “IT IS OUT OF RANGE”
END SELECT
END



7. Wap to enter full name and display the initials only.

 CLS
INPUT “ENTER FULL NAME”;N$
C$=LEFT$(N$,1)
FOR I= 1 TO LEN(N$)
IF MID$(N$,I,1) = “ ” THEN
C$=C$ + MID$(N$,I+1,1)
END IF
NEXT I
PRINT “THE INITIALS ARE”;C$
END


8. Wap to convert binary into decimal.
INPUT B
I=0
DO
R= B MOD 10
D= D + R * 2^I
I=I+1
B=B10
LOOP WHILE B<>0
PRINT “DECIMAL”;D
END


9.Wap to convert decimal no. into binary.
CLS
INPUT D
B=2
WHILE  D<>0
R= D MOD B
D=DB
B$=STR$(R) + B$
WEND
PRINT B$


10. Display the sum of the digits of the entered number by the user
CLS
INPUT “enter any number”;N
LET S = 0
TOP:
LET L = N MOD 10
LET S = S + L
LET N = N \ 10
IF N > 0 THEN GOTO TOP
PRINT “the sum of the digits of the number is:”;S
END



Tuesday, July 12, 2016

Hello!

If  have any problems regarding programming of any topic comment in the section below and I will try to solve your problem ASAP. -NerdyCoder

HTML- Styling tables with CSS

In this tutorial, we are going to learn about how to design tables in HTML with the help of CSS (Cascading Style Sheets). I took a look at wiki and made a decision to make a tutorial regarding video games. I have 5 games and their info and have designed it.

HTML code

<html>
<head>
<meta charset="utf-8"/>
<title> Styling Tables </title>
<link rel="stylesheet" href="styling tables.css">
</head>
<body>
<table border="1">
<caption> Best selling games according to Wiki</section>
<thead>
<tr>
<th> Rank </th>
<th> Title </th>
<th> Release year </th>
<th> Copies Sold </th>
</tr>
</thead>
<tbody>
<tr>
<td> 1 </td>
<td>Tetris</td>
<td>1984</td>
<td>143 million</td>
</tr>
<tr>
<td> 2 </td>
<td>Wii Sports</td>
<td>2006</td>
<td>81.99 million</td>saying th
</tr>
<tr>
<td> 3 </td>
<td>Minecraft</td>
<td>2009</td>
<td>49.5 million</td>
</tr>
<tr>
<td> 4 </td>
<td>Super Mario Brothers</td>
<td>1985</td>
<td>35.53 million</td>
</tr>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan=4> info from wikipedia </td>
</tr>
</tfoot>
</table>
</body>
</html>

CSS
table{
 border:1px solid black;
 border-collapse:collapse;
}

th,td{
 border:1px solid black;
 padding:5px;
}

tr:nth-child(2n) {
 background-color:#a0a0a0;
}

thead{
 background-color:#ccddee;
}

tfoot{
 background-color:#ddccee;
 text-align:center;
}

Output


Sunday, July 10, 2016

HTML- Using anchor tag



Hi guys, in this code you are going to learn about the effects of three different tags in HTML.In this code, we will learn about the effects of anchor tag.  I hope this code is going to help you progress in HTML. It is simple, all you need to do is copy the code and paste it in your document where you write codes.  The remaining editing depends on you. Feel free to leave a comment no matter whether it is positive or negative.


Follow these steps
1. Open two tabs in the document where your code.
2.  Name one as home.html and the other as another.html and save it.

Code
<!DOCTYPE html>
<html>
<head>
<meta charset= "utf-8">
<title> Anchor Tag </title>
</head>
<body>
<h1>  My Home page</h1>
<p> Would to like to go to the <a href="another.html">another </a>home page? </p>
</body>
</html>

Output






Saturday, July 9, 2016

HTML- Line Breaks,Paragraphs and Headers



Hi guys, in this code you are going to learn about the effects of three different tags in HTML. I hope this code is going to help you progress in HTML. It is simple, all you need to do is copy the code and paste it in your document where you write codes.  The remaining editing depends on you. Feel free to leave a comment no matter whether it is positive or negative.

Code



<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title> Headers, Paragraphs and Line Breaks </title>

</head>
<body>
<h1> This is a biggest header. </h1>
<h2> This is a second biggest header. </h2>
<h3> This is a third biggest header. </h3>
<h4> This is a third smallest header. </h4>
<h5> This is a second smallest header. </h5>
<h6> This is a smallest header. </h6>
<p> The paragraph tag has starting and closing tag. It is used to create paragraph effects in a HTML document </p>

This is the line break tag. It is used to </br>  break the lines.
</body>
</html>

Output

HTML- Audio Tag

Before you start coding, follow these instructions-

1. Create a folder and name it Audio Tag
2. Save an audio there- Eg. Perfect
3. Go to the coding document, and save the file in the folder Audio Tag with extension .html


Code

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title> Audio Tag </title>
</head>
<body>
<audio controls autoplay loop>
<source src="perfect" type="mp3/mpeg">
</audio>
</body>
</html>