0% found this document useful (0 votes)
15 views

HTML HW

Uploaded by

Apurva Pandey
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

HTML HW

Uploaded by

Apurva Pandey
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Table of Contents

Part 1: HTML ................................................................................................................................................. 2


1.1: To make a table with cell that spans two rows ................................................................................. 2
1.2: Make a list .......................................................................................................................................... 3
Part 2: C Programming .................................................................................................................................. 3
2.1: Program to read salaries for 300 employees and count the number of employees getting salary
from 10,000 to 15,000. ............................................................................................................................. 3
2.2: To print the pattern ........................................................................................................................... 4
2.3: Find Smallest and Largest Number ................................................................................................... 5
Part 1: HTML

1.1: To make a table with cell that spans two rows

Note: <br> tag can be used in a cell to span it in two rows also or ‘rowspan’ attribute can be
used in the other cells of the row in <td> tag

<html> <body>
<h4>Cell that spans two rows:</h4>
<table border="1">
<tr>
<th>S.N.</th>
<th>Name of Player</th>
<th>Played for</th>
</tr>
<tr>
<td>1.</th>
<td>Lionel Messi</td>
<td>Argentina</td>
</tr>
<tr>
<td>2.</th>
<td>Cristiano Ronaldo</td>
<td>Portugal</td>
</tr>
<tr>
<td rowspan="2">3.</th>
<td >Neymar</td>
<td rowspan="2">Brazil</td>
</tr>
<tr>
<td >Marcelo</td>
</tr>
<tr>
<td rowspan="2">4.</th>
<td >Antoine Grizeman</td>
<td rowspan="2">Brazil</td>
</tr>
<tr>
<td >N'Golo Kante</td>
</tr>
</table>
</body> </html>

1.2: Make a list

<html><body>

<ul type="square">

<li>Veg. Item</li>

<ol type="I">

<li>Veg Momo</li>

<li>Panir Tikka</li>

</ol>

<li>Non-Veg item</li>

<ol type="a">

<li>Chicken momo</li>

<li>fried mom</li>

</ol></ul></body></html>

Part 2: C Programming

2.1: Program to read salaries for 300 employees and count the number of employees
getting salary from 10,000 to 15,000.

#include <stdio.h>
#include <conio.h>

void main()

int salary[300],i,n,count=1;
printf("\n Input salary of 300
persons");

for(i=0;i<300;i++);
scanf("%d",&salary[i]);

for(i=0;i<300;i++)
{
if(salary[i]>10000
&& salary[i]<15000)
count++;
}

printf("There are %d persons whose salary is in between 10000 and 15000", count);
}

2.2: To print the pattern


54321
5432
543
54
5
#include<stdio.h>

#include<conio.h>

void main()

int i,j;

for (i=1; i<=5; i++)

for (j=5; j>=i; j--)

printf("%d",j);

printf("\n");
}

2.3: Find Smallest and Largest Number

/* Find Largest and Smallest numbers*/

#include<stdio.h>

void main()

int A[50], n, i, max, min;

printf("Enter the numbers\t");

scanf("%d", &n);

for(i=0;i<n;i++)

scanf("%d", &A[i]);

min =A[0];

max=A[0];

for(i=0;i<n;i++)

if(A[i]>max) max=A[i];

for(i=0;i<n;i++)

if(A[i]<min)

min=A[i];

printf("Largest number is = %d\n Smallest number is = %d", max, min);

You might also like