02Jun/16

Program to display a series 1,2,3…10 using for, while and do…while loop

Using for loop:

#include<stdio.h>
int main( )
{
 int i;
 for(i=1; i<=10; i++)
 {
   printf("%d\t",i);
 }
 return 0;
}

Output:

1  2  3  4  5  6  7  8  9  10

Using while loop:

#include<stdio.h>
int main( )
{
 int i=1;
 while(i<=10)
 {
   printf("%d\t", i);
   i++;
 }
}

Output:

1  2  3  4  5  6  7  8  9  10

Using do…while loop:

#include<stdio.h>
int main( )
{
 int i=1;
 do{
   printf("%d\t", i);
   i++;
 }while(i<=10);
}

Output:

1  2  3  4  5  6  7  8  9  10
02Jun/16

Syntax of for loop, while loop, nested for loop

Syntax of for loop:

for(initialization; condition; increment/decrement)
{
  statement(s);
}

Syntax of while loop:

initialization;
while (condition)
{
 statement(s); 
 increment/decrement; 
}

Syntax of nested for loop:

for(initialization; condition; increment/decrement)
{
  for(initialization; condition; increment/decrement)
     {
        statement(s);
     }
}

Syntax of nested do…while loop:

do {
   statement(s);
} while(condition);
02Jun/16

A program to Check Vowel or consonant

Program Code:

#include <stdio.h>
int main()
{
    char c;
    int LowercaseVowel, UppercaseVowel;

    printf("Enter an alphabet: ");
    scanf("%c", &c);

    LowercaseVowel = (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');

    UppercaseVowel = (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U');

    if (LowercaseVowel || UppercaseVowel)
        printf("%c is a vowel.", c);
    else
        printf("%c is a consonant.", c);
    return 0;
}

Output:

Enter an alphabet: Y
Y is a consonant.
01Jun/16

A program to print half pyramid using *

Program Code:

#include<stdio.h>
int main( )
{
 int i,j,rows;
 printf("Enter the number of rows:");
 scanf("%d",&rows);
 for(i=1;i<=rows;i++)
 {
   for(j=i;j>0;j--)
   {
     printf("* ");
   }
   printf("\n");
 }
}

Output:

Enter the number of rows:7
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
03Dec/15

Software Engineering Assignment

Assignment

Dear Students,
Good day!
I do believe you have learnt a lot of things about HTML and a little about CSS. Now this is your turn to create your personal web site which will be counted as an assignment. Ensure that the following criteria are included in your assignment:

  • This assignment has to be created individually.
  • Publish your assignment (website) to a free host site e.g. http://megabyet.com/ and send the link to my e-mail bulbul2767@gmail.com by December 18, 2015.
  • If two assignments are similar, both of them will get Zero.
  • Your website must contain at least five pages including the index page.
  • Index page (index.html) should be filled with relevant information and images.
  • Add at least four links in your index page.
  • Make at least one page using div tag.
  • Add at least two web site links in your index page.
  • Use proper header and footer.
  • Create menu using HTML and CSS
  • Link at least one CSS file (e.g. style.css) in your website with relevant applications.

Please feel free to contact me if you have further queries. 

12Nov/15

Example of Ordered List

ol: ordered list
li: list

HTML Code (index.html)

<html>
<head>
<title>Example of Ordered List</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
	<h1>Program Names</h1>
	<h3>Unordered List</h3>
		<ol>
			<li>BBA</li>
			<li>MBA</li>
			<li>CSE</li>
			<li>LLB</li>
			<li>EEE</li>
		</ol>		
</body>
</html>

CSS Code (style.css)

body{
background-color:#66FF33;
}

h1{
color:#FFFFFF;
background-color:#000000;
text-align:center;
}

h3{
color:#0000FF;
text-decoration:underline;
}