Monday, August 6, 2012

List of Important My SQL Query used

1.         a)         Create your own database.
 create database Practical;




 
b)         Create table within it with the following fields giving name as Employee
            table.   (Empno,  empname, Job, Salary, Deptno.)

create table Practical.Employee(
Empno int(5),
Empname varchar(50),
Job varchar(50),
Salary float(10,2),
Deptno int(3)
);          

Saturday, March 10, 2012

C Programs Lists With their output

Write a C program to check whether a given number is palindrome or not.

#include 
#include 
void main()
{
 long int n, num, rev = 0, dig;
 printf("\n Enter a number...: ");
scanf("%ld", &num);
 n = num;
while(num>0)
{
dig = num % 10;
 rev = rev * 10 + dig;
 num = num / 10;
 }
 if (n == rev)
 printf("\nGiven number is a palindrome");
 else
 printf("\n Given number not a palindrome");
 getch();
}

Write a program to check whether a given number is armstrong or not.




#include  
#include  
void main()
{
 int a,b,y,m,q;
printf(“Enter any no. \n”);
scanf(“%d”,&a);
 b=a;
y=0;
while(b!=0)
{
 m=b%10;
 q=b/10;
 y=y+(m*m*m);
 b=q;
}
if(y==a)
{
printf(“ The no. is Armstrong\n”); printf("%d\n",a);
}
else
{


printf(“ The no. is not Armstrong\n”); printf("%d\n",a);
}
getch();

}

Write a C program to find prime numbers from 1 to n.

#include
#include
void main()
{
int i,j,n;
clrscr();
printf("Enter the no: ");
scanf("%d",&n);
printf("\n");
for(i=1;i<=n;i++)
{
for(j=2;j<=i-1;j++)
{
if(i%j==0)
break;
}
if(j==i)
printf("%d ",j);
}
getch();
}

Write a C program to find the sum of first n natural numbers.

#include  
#include
void main()
{
 int i, n, sum = 0;
clrscr();
printf(“Enter an integer number\n”);
scanf (“%d”, &n);
for (i=1; i <= n; i++)
{
 sum = sum + i;
}
printf (“Sum of first %d natural numbers = %d\n”, n, sum);

getch();
}

Write a program to find the factorial of a number using loop.

#include
#include
void main()
{
int a,b,fact=1;
clrscr();
printf("Enter number to find factorial");
scanf("%d",&b);
for(a=b;a>0;a--)
{
fact=fact*a;
}
printf("%d ",fact);
getch();
}

Write a C program to find the factorial of a number using recursion.

#include
#include
int fact(int);
void main()
{
int num,fact1;
printf("Enter a value of num");
scanf("%d",&num);
fact1=fact(num);
printf("factorial=%d",fact1);
getch();
}
int fact(int n)
{
int f=1;
if(n==0)
{
return 1;
}
else
{
f=n*fact(n-1);
return(f);
}
}

Write a program to find fibonacci series in c using loop.

#include
#include
void fiab(int n)
{
int a=0,b=1,add=0;
printf("%d %d ",a,b);
while(add
{
add=a+b;
a=b;
b=add;
printf("%d ",a);
}
}

void main()
{
int i,j,a,b;
clrscr();
printf("\n Enter number to print fibonacci number:\n");
scanf("%d",&a);
printf("\n Fiabonacci series:\n");
fiab(a);
getch();
}

Write a program to find fibonacci series in c using recursion.

#include
#include
int fiab(int);

void main()
{
int i,n;
clrscr();
printf("How many terms do you wish to find?\n");
scanf("%d",&n);

printf("\nThe Series is : \n");

for(i=1;i<=n;i++)
{
printf(" %d \n",fiab(i));
}

getch();
}

int fiab(int n)
{
if(n==1||n==2){
return 1;}
else{
return(fiab(n-1)+fiab(n-2));}
return 0;
}
 

Write a C program to print the following Pattern

A) 1      
     1 2
     1 2 3
     1 2 3 4 


#include
#include
void main()
{
int i,j;
clrscr();
for(i=0;i<5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ", j);
}
printf("\n");
}
getch();
}


B)  1
      2 2
      3 3 3
      4 4 4 4 

#include
#include
void main()
{
int i,j;
clrscr();
for(i=0;i<5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ", i);
}
printf("\n");
}
getch();
}





Saturday, February 11, 2012

Valentines Day & Facts about it

Celebrated on February 14, Valentines Day is the festival of love birds across the world, irrespective of the nation, caste, religion or creed. Love birds across the nation await this event desperately throughout the year. However the story of its origin is still under blurred sacks. There are different ideas to the way Valentines Day celebration began. Some trace it to Lupercalia, an ancient Roman festival while other experts associate the event with two saints named valentine of the early Christian church. One of them would secretly conduct marriage of couples by disobeying the rule of Roman Emperor, Claudius; while other was a lover of children but, was imprisoned when he would not honor other gods. The children missed him and wrote messages of affection to him through the bars of the cell. This can be considered as the beginning of exchanging messages. Still others link it with an old English belief that love birds choose their mates on February 14. Valentine's Day probably came from a combination of all the above sources, along the belief that spring is a time for lovers. Read on to find out all interesting facts about this festival.

Fun Facts On Valentine’s Day
  • The modern day celebration of Valentines Day is believed to begin in France and England.
  • Cupid (symbol for Roman God of love), doves, love birds, roses, hearts and arrows are all symbols of the Valentine’s Day celebration.
  • Pope Gelasius declared February 14 St. Valentine's Day around 498 A.D.
  • In Great Britain, Valentine's Day began to be celebrated around seventeenth century. By the middle of the eighteenth century, it was common for friends and lovers to exchange small tokens of affection or handwritten notes.
  • In Medieval times, girls ate bizarre foods on St Valentine's Day to dream of their future spouse. 
  • There was a belief in the Middle Ages that the first unmarried person (of the opposite sex) you met on the morning of St. Valentine's Day would become your spouse.
  • The first Valentine gift was sent by Duke of Orleans to his wife, after he was captured in 1415.
  • 73% of Valentine Day flowers are bought by men, whereas women buy only 23% of Valentine flowers.
  • Around 3% of pet owners prefer to give Valentine gifts to their pets, as they are more grateful than humans.
  • In oden times, some people believed that if a woman saw a robin flying overhead on Valentine's Day, it meant she would marry a sailor. If she saw a sparrow, she would marry a poor man and be very happy. If she saw a goldfinch, she would marry a millionaire.
  • The heart is the most common symbol of romantic love. Ancient cultures believed the human soul lived in the heart and its red color is though to be the most romantic.
  • The red rose was the favorite flower of Venus, the Roman goddess of love. Since red stands for strong feelings, red rose is a flower of love.
  • The first Valentine's Day box of chocolates was introduced by Richard Cadbury in 1868.
  • In Wales, wooden love spoons were carved and given as gifts on Valentine’s Day. Hearts, keys and keyholes were favorite Valentine decorations on the wooden spoons that meant, "You unlock my heart!"

14 Miserable Facts About St Valentine’s Day 

1. In the two week period leading up to Valentine’s Day, American sales of gold jewelry lead to 34 million metric tons of waste.
2. The vast majority of roses sold for Valentine’s Day in the U.S. are imported from South America, wasting fossil fuels.
3. Valentine’s Day traces its roots to an ancient pagan holiday called Lupercalia, in which men stripped naked, grabbed whips, and spanked young women in hopes of increasing their fertility.
4. The Christian martyr St. Valentine was beheaded on February 14 for performing marriages in secret.
5. Research suggests that 75 percent of suicide attempts are attributable to relationship problems.
6. 46 percent of Americans will exchange Valentine’s Day candy.
7. 67 percent of Americans are overweight or obese.
8. The first Valentine’s Day card was sent by Charles, Duke of Orleans, to his wife while he was imprisoned in the Tower of London. He remained a prisoner of war for the next twenty-four years.
9. A recent poll found that one in ten young adults admitted to feeling lonely, insecure, depressed, or unwanted on Valentine’s Day. And that’s just the ones that admitted it.
10. Forty percent of people have negative feelings towards Valentine’s Day.
11. The famous St. Valentine’s Day Massacre, in which seven Chicago gangsters were gunned down on February 14, 1929, was one of the bloodiest in mob history (pictured above).
12. 64 percent of American men do not make Valentine’s Day plans in advance.
13. Candy hearts taste like crap.
14. Even if you’re really, really in love right now, you’re still going to die eventually.
15. In reality, there were actually 3 St. Valentine’s. One was a priest, one a bishop and one little is known about except he was a martyr. The stories of the priest’s and bishop’s martyrdom are so closely related it is difficult to tell which St. Valentine the Holiday is named after.
16. According to legend it was St. Valentine himself who sent the first valentine in the form of a letter to his jailer’s blind daughter with whom he had fallen in love. Just before he was put to death at the hands of King Claudius II for marrying the kings soldiers without the king’s permission he penned a note to his love and signed it: From your Valentine.
17. It is believed that a mount Holyoke college student by the name of Ester Howland created the first lace valentine in the United States from lace, ribbon and colorful pictures. She has become known as the Mother of the Valentine.
18. Teachers receive more valentine cards than anyone else, even children.
19. More than 650 million valentine cards are exchanged by children from ages 6-10 each year. Most of these cards are bought in the last 6 days leading up to Valentine’s day.
20. Each year the city of Verona Italy receives more than 1000 valentine’s addressed to Shakespeare’s Juliet. It really is amazing how much affection a dead fictional character can attract.
21. It was once believed that if a woman saw a flying robin on Valentine’s day she would end up getting married to a sailor. If a sparrow was the bird she saw she would end up marrying a man that was poor and live a happy life, if she saw a goldfinch then she was to marry a man that was a millionaire. One can only wonder who she would marry if she saw a crow.
22. In 1929 at the height of prohibition Al Capone ordered the killing of members of a rival gang run by Bugs Moran in Chicago on Valentines Day. Authorities were unable to find any real evidence to tie Capone to the crime and he was never arrested or tried for the murder of these seven men. Instead he served his time for tax evasion.
23. More than 9 million pet owners buy gifts for their pets for Valentine’s day. Now that is what can be called real puppy love.
24. It is estimated that 15% of the women in the United States who receive flowers for Valentine’s day send them to themselves. There are no figures that tell how many of these women are married, single or in a relationship.



Saturday, March 19, 2011

Holi the Festival of Colors in INDIA

Wish You All the Visitors, Friends and Family a Very Very Happy Colour full Holi.

Holi, or Holli (Hindi: होली), is a spring religious festival celebrated by Hindus. It is primarily observed in India, Nepal, Sri Lanka,[1] and countries with large Indic diaspora populations, such as Suriname, Malaysia, Guyana, South Africa, Trinidad, United Kingdom, United States, Mauritius, and Fiji. In West Bengal and Orissa of India it is known as Dolyatra (Doul Jatra) or Basanta-Utsav ("spring festival"). The most celebrated Holi is that of the Braj region, in locations connected to the god Krishna: Mathura, Vrindavan, Nandagaon, and Barsana. These places have become tourist destinations during the festive season of Holi, which lasts here to up to sixteen days.[2]
The main day, Holi, also known as Dhuli Vandana in Sanskrit,also Dhulheti, Dhulandi or Dhulendi, is celebrated by people throwing coloured powder and coloured water at each other. Bonfires are lit the day before, also known as Holika Dahan (burning of Holika) or Chhoti Holi (little Holi). The bonfires are lit in memory of the miraculous escape that young Prahlad accomplished when Demoness Holika, sister of Hiranyakashipu, carried him into the fire. Holika was burnt but Prahlad, a staunch devotee of god Vishnu, escaped without any injuries due to his unshakable devotion. Holika Dahan is referred to as Kama Dahanam in South India.

One of the major festivals of India, Holi is celebrated with enthusiasm and gaiety on the full moon day in the month of Phalgun which is the month of March as per the Gregorian calendar.

Holi festival may be celebrated with various names and people of different states might be following different traditions. But, what makes Holi so unique and special is the spirit of it which remains the same throughout the country and even across the globe, wherever it is celebrated.

Preparations

Entire country wears a festive look when it is time for Holi celebration. Market places get abuzz with activity as frenzied shoppers start making preparations for the festival. Heaps of various hues of gulal and abeer can be seen on the roadside days before the festival. Pichkaris in innovative and modern design too come up every year to lure the children who wish to collect them as Holi memorabilia and of course, to drench everybody in the town.

Womenfolk too start making early preparations for the holi festival as they cook loads of gujiya, mathri and papri for the family and also for the relatives. At some places specially in the north women also make papads and potato chips at this time.

Season of Bloom
Everybody gets delighted at the arrival of Holi as the season itself is so gay. Holi is also called the Spring Festival - as it marks the arrival of spring the season of hope and joy. The gloom of the winter goes as Holi promises of bright summer days. Nature too, it seems rejoices at the arrival of Holi and wears its best clothes. Fields get filled with crops promising a good harvest to the farmers and flowers bloom colouring the surroundings and filling fragrance in the air.

Legends
A Hindu festival, Holi has various legends associated with it. The foremost is the legend of demon King Hiranyakashyap who demanded everybody in his kingdom to worship him but his pious son, Prahlad became a devotee of Lord Vishnu. Hiranyakashyap wanted his son to be killed. He asked his sister Holika to enter a blazing fire with Prahlad in her lap as Holika had a boon which made he immune to fire. Story goes that Prahlad was saved by lord himself for his extreme devotion and evil minded Holika was burnt to ashes, for her boon worked only when she entered the fire alone.

Since that time, people light a bonfire, called Holika on the eve of Holi festival and celebrate the victory of good over evil and also the triumph of devotion to god. Children take special delight in the tradition and this has another legend attached to it. It says that there was once an ogress Dhundhi who used to trouble children in the kingdom of Prithu. She was chased away by children on the day of Holi. Therefore, children are allowed to play pranks at the time of 'Holika Dahan'.

Some also celebrate the death of evil minded Pootana. The ogress tried to Lord Krishna as an infant by feeding it poisonous milk while executing the plan of Kansa, Krishna's devil uncle. However, Krishna sucked her blood and brought her end. Some who view the origin of festivals from seasonal cycles believe that Pootana represents winter and her death the cessation and end of winter.

In South India, people worship Kaamadeva- the god of love and passion for his extreme sacrifice. According to a legend, Kaamadeva shot his powerful love arrow on Lord Shiva to revoke his interest in the worldly affairs in the interest of the earth. However, Lord Shiva was enraged as he was in deep mediation and opened his third eye which reduced Kaamadeva to ashes. Though, later on the request of Rati, Kaamadeva's wife, Shiva was pleased to restore him back.

Holika Dahan
On the eve of Holi, called Chhoti or Small Holi people gather at important crossroads and light huge bonfires, the ceremony is called Holika Dahan. This tradition is also followed in Gujarat and Orissa. To render greatfulness to Agni, god of Fire, gram and stalks from the harvest are also offered to Agni with all humility. Ash left from this bonfire is also considered sacred and people apply it on their foreheads. People believe that the ash protects them from evil forces.

Play of Colors
Holi FestivalGreat excitement can be seen in people on the next day when it is actually the time for the play of colours. Shops and offices remain closed for the day and people get all the time to get crazy and whacky. Bright colours of gulal and abeer fill the air and people take turns in pouring colour water over each other. Children take special delight in spraying colours on one another with their pichkaris and throwing water balloons and passers by. Women and senior citizen form groups called tolis and move in colonies - applying colours and exchanging greetings. Songs, dance on the rhythm of dholak and mouthwatering Holi delicacies are the other highlights of the day.

Expression of Love
Lovers too long to apply colours on their beloved. This has a popular legend behind it. It is said that the naughty and mischievous Lord Krishna started the trend of playing colours. He applied colour on her beloved Radha to make her one like him. The trend soon gained popularity amongst the masses. No wonder, there is no match to the Holi of Mathura, Vrindavan and Barsana - the places associated with the birth and childhood of Radha and Krishna.

Ecstasy of Bhang
There is also a tradition of consuming the very intoxicating bhang on this day to further enhance the spirit of Holi. It is so much fun to watch the otherwise sober people making a clown of themselves in full public display. Some, however, take bhang in excess and spoil the spirit. Caution should therefore be taken while consuming bhang delicacies.

Sober Evening
After a funfilled and exciting day, the evenings the spent in sobriety when people meet friends and relatives and exchange sweets and festive greetings.

It is said the spirit of Holi encourages the feeling of brotherhood in society and even the enemies turn friend on this day. People of all communities and even religions participate in this joyous and colouful festival and strenthen the secular fabric of the nation.

History of Holi
Holi is an ancient festival of India and was originally known as 'Holika'. The festivals finds a detailed description in early religious works such as Jaimini's Purvamimamsa-Sutras and Kathaka-Grhya-Sutras. Historians also believe that Holi was celebrated by all Aryans but more so in the Eastern part of India.

It is said that Holi existed several centuries before Christ. However, the meaning of the festival is believed to have changed over the years. Earlier it was a special rite performed by married women for the happiness and well-being of their families and the full moon (Raka) was worshiped.

Calculating the Day of Holi
There are two ways of reckoning a lunar month- 'purnimanta' and 'amanta'. In the former, the first day starts after the full moon; and in the latter, after the new moon. Though the amanta reckoning is more common now, the purnimanta was very much in vogue in the earlier days.

According to this purnimanta reckoning, Phalguna purnima was the last day of the year and the new year heralding the Vasanta-ritu (with spring starting from next day). Thus the full moon festival of Holika gradually became a festival of merrymaking, announcing the commencement of the spring season. This perhaps explains the other names of this festival - Vasanta-Mahotsava and Kama-Mahotsava.

Reference in Ancient Texts and Inscriptions
Besides having a detailed description in the Vedas and Puranas such as Narad Purana and Bhavishya Purana, the festival of Holi finds a mention in Jaimini Mimansa. A stone incription belonging to 300 BC found at Ramgarh in the province of Vindhya has mention of Holikotsav on it. King Harsha, too has mentioned about holikotsav in his work Ratnavali that was written during the 7th century.

The famous Muslim tourist - Ulbaruni too has mentioned about holikotsav in his historical memories. Other Muslim writers of that period have mentioned, that holikotsav were not only celebrated by the Hindus but also by the Muslims.

Reference in Ancient Paintings and Murals
History of HoliThe festival of Holi also finds a reference in the sculptures on walls of old temples. A 16th century panel sculpted in a temple at Hampi, capital of Vijayanagar, shows a joyous scene of Holi. The painting depicts a Prince and his Princess standing amidst maids waiting with syringes or pichkaris to drench the Royal couple in coloured water.

A 16th century Ahmednagar painting is on the theme of Vasanta Ragini - spring song or music. It shows a royal couple sitting on a grand swing, while maidens are playing music and spraying colors with pichkaris.

There are a lot of other paintings and murals in the temples of medieval India which provide a pictoral description of Holi. For instance, a Mewar painting (circa 1755) shows the Maharana with his courtiers. While the ruler is bestowing gifts on some people, a merry dance is on, and in the center is a tank filled with colored water. Also, a Bundi miniature shows a king seated on a tusker and from a balcony above some damsels are showering gulal (colored powders) on him.

Legends and Mythology
In some parts of India, specially in Bengal and Orissa, Holi Purnima is also celebrated as the birthday of Shri Chaitanya Mahaprabhu (A.D. 1486-1533). However, the literal meaning of the word 'Holi' is 'burning'. There are various legends to explain the meaning of this word, most prominent of all is the legend associated with demon king Hiranyakashyap.

Hiranyakashyap wanted everybody in his kingdom to worship only him but to his great disappointment, his son, Prahlad became an ardent devotee of Lord Naarayana. Hiaranyakashyap commanded his sister, Holika to enter a blazing fire with Prahlad in her lap. Holika had a boon whereby she could enter fire without any damage on herself. However, she was not aware that the boon worked only when she enters the fire alone. As a result she paid a price for her sinister desires, while Prahlad was saved by the grace of the god for his extreme devotion. The festival, therefore, celebrates the victory of good over evil and also the triumph of devotion.

Legend of Lord Krishna is also associated with play with colors as the Lord started the tradition of play with colours by applying colour on his beloved Radha and other gopis. Gradually, the play gained popularity with the people and became a tradition.

There are also a few other legends associated with the festival - like the legend of Shiva and Kaamadeva and those of Ogress Dhundhi and Pootana. All depict triumph of good over evil - lending a philosophy to the festival.