Search This Blog

Sunday, August 22, 2010

C language

Diamond Program (with '*')



#include
#include
#include
void main(void)
{int a=9;
clrscr();
for(int l=1;l<=5;l++)
{
for(int m=1;m<=5-l;m++){printf(" ");}
for(int n=1;n<=(2*l)-1;n++){printf("*");}
printf("\n");
}
for(int i=0;i<=5;i++)
{
a=a-2;
for(int j=0;j<=i;j++){printf(" ");}
for(int k=a;k>0 ;k--){printf("*");}
printf("\n");
}
getche();
}


Diamond Program (with 'digits') 


#include
#include
#include
void main(void)
{int a=9;
clrscr();
for(int l=1;l<=5;l++)
{
for(int m=1;m<=5-l;m++){printf(" ");}
for(int n=1;n<=(2*l)-1;n++){printf("%d",l);}
printf("\n");
}
for(int i=0;i<=5;i++)
{
a=a-2;
for(int j=0;j<=i;j++){printf(" ");}
for(int k=a;k>0 ;k--){printf("%d",4-i);}
printf("\n");
}
getche();
}


CALCULATOR
(with 'case switch')



#include
#include
void main(void)
{
int a,b;
char c,r;
do{
clrscr();
printf("\nEnter \"Digit Operator Digit \" to perform calculation\t");
scanf("%d %c %d",&a,&c,&b);
switch(c){
case'+':printf("\n%d %c %d = %d",a,c,b,a+b);break;
case'-':printf("\n%d %c %d = %d",a,c,b,a-b);break;
case'*':printf("\n%d %c %d = %d",a,c,b,a*b);break;
case'/':printf("\n%d %c %d = %d",a,c,b,a/b);break;
default:printf("\n>>>>You typed a wrong operator");}
printf("\n\nWant to perform another calculation\t");
r=getche();
}while(r=='y');
getche();
}
 

CALCULATOR (with 'else if')


 
#include
#include
void main(void)
{
int a,b;
char c,r;
do{
clrscr();
printf("\nEnter \"Digit Operator Digit \" to perform calculation\t");
scanf("%d%c%d",&a,&c,&b);
if(c=='+'){printf("\n%d %c %d = %d",a,c,b,a+b);}
else if(c=='-'){printf("\n%d %c %d = %d",a,c,b,a-b);}
else if(c=='*'){printf("\n%d %c %d = %d",a,c,b,a*b);}
else if(c=='/'){printf("\n%d %c %d = %d",a,c,b,a/b);}
else {printf("\n>>>>You typed a wrong operator");}
printf("\n\nWant to perform another calculation\t");
r=getche();
}while(r=='y');
getche();
}

Any Table with range option


#include
#include
void main(void)
{
int a,b,c; clrscr();
printf("Enter the table u want\t"); scanf("%d",&a);
printf("\nEnter the initial range point\t"); scanf("%d",&b);
printf("\nEnter the final range point\t"); scanf("%d",&c);
for(int i=b;i<=c;i++){printf("\n\n\t>>> %d*%d=%d <<<\n",a,i,a*i);}
getche();
}
 

Fabonnaci series


 #include
#include
void main(void)
{
int k,a=0,b=1,c;
clrscr();
for(k=0;k<=15;k++)
{
printf("%d\t",a+b);
c=b;
b=a+b;
a=c;
}
getche();
}






 
 

Saturday, August 7, 2010

Islamiat presentation

CIVILIZATION:-
        The topic that we have been tasked to speak on is CIVILIZATION. Lets First analyze what Civilization means. It can be defined as
            “ The expression of a system of beliefs, values and principles as well as the synthesis of human activities in the various fields of science, literature and art, without any distinction whatsoever, along with the ensuing trends, tendencies shaping the pattern of conduct, the lifestyle, the way of thinking”
            In short we can say that
 “Civilization is a social system which allows man to increase his cultural production.”
One thing that always puzzled our mind is the difference between Civilization and Culture
Culture is a system of shared beliefs, values, customs, behaviors, and artifacts that the members of society use to cope with their world and with one another, and that are transmitted from generation to generation through learning.
Civilization is a complex society that has cities, social classes, and government. Culture is just one aspect of civilization.
It's possible for a culture to exist without civilization, but a civilization cannot exist without culture. In addition, a civilization can include more than one culture.
Now come to what characteristics makes up a civilization
Characteristics of Civilization
            These seven characteristics of civilization are important, because without them people couldn't co-exist with each other.
1.  Urban society:  Living together in communities.
2.  Religion:  Beliefs that provide answers to “unanswerable” questions.
3.  Literacy:  The ability to read and write.
4.  Government:  Having a set of rules, leaders or organization to society
5.  Specialization:  Using unique skills to benefit all.
6.  Social classes:  Groups of people with common characteristics.
7.  Leisure:  Recognizing the value of the arts and entertainment.
8. Education/criticism:  Striving to improve as an individual or as a culture.

Now come to the point that what led civilizations to become extinct
DOWNFALL OF A CIVILIZATION

           War, drought, natural disaster, disease, overpopulation, economic disruption: any of these or a combination of these events can bring about the collapse of a civilization. Internal causes (such as political struggles or overfarming) can combine with external causes (such as war or natural disaster) to bring about a collapse.

The cause of the fall of a civilization occurs when a cultural elite becomes a parasitic elite, leading to the rise of internal and external differences.
            Tyrants and inefficient and ineffective rulers is one of the most common causes. The Shang dynasty met its end at the hands of an inefficient ruler             

               Another common cause : weak military power. Weak military power, in the olden days, did not only mean a civilization could not invade its neighbors and expand its power; it also meant itself was susceptible to attacks by greedy neighbors, being unable to resist the military mightiness of the latter.             
              The above two reasons are perhaps the only root causes of the fall of an empire. Everything else branches out from there; inefficient administration-a result of a weak ruler, rebellions by one's own people--because the ruler is a tyrant, because the empire possesses some rare raw materials--unable to withstand the attacks by the greedy neighbour because it is weak militarily.

The concept of Islamic civilization :     
The Islamic civilization is the outcome of the interaction between the cultures of the peoples who converted to Islam either out of faith and conviction or out of allegiance and affiliation. It is the offspring of the cross-fertilization of the cultures and civilizations that were existing in the regions brought under the umbrella of Islam during Islam’s expansion, and the product of their melting in the pot of the principles, values and ideals that came with Islam as a guidance for all the people on Earth.
characteristics of Islamic civilization
1, Monotheistic civilization
based on the belief in the oneness of Allah Almighty, the Creator of men and all creatures.
            2, Islamic Civilization is universal,
is not confined to a particular geographic region, race or historical era rather concerning to all people and nations of the world.
3, A generous civilization
which drew on the human civilizations and cultures experienced by the peoples of the ancient world, but contributed a lot to the advancement of science, knowledge and the values of justice, quality, beauty and virtue. Its output benefited humanity at large, regardless of race, color or even religion.
4, A well-balanced civilization
which secures fair equilibrium between the materialistic and the spiritual sides with exemplary moderation based on justice and
5, An indefinitely lasting civilization
which will last as long as Islam, because it is based on the very principles of Islam which Allah will preserve eternally. It never withers away since it is not a national or a racial civilization nor does it run counter to human nature. Muslims may become weak or less influential but Islam remains firm. The Islamic civilization is therefore permanently buoyant and has self renewing cycles

After defining all these characteristics lets analyze shortly what were the impacts of Islamic civilization on our subcontinent.
1.      Before Islam women were to be ablaze after her husband’s death and if left she has no right in her husband’s property. Islam gives them not only a right to live but also to marry again and she got a fixed share from her husband’s left over.
2.      Islam exterminates the prevalent cast system in India and declared all human beings as equal