Monday, January 17, 2011

PROGRAM : DECIMAL TO BINARY CONVERSION

ASALAM WALAKUM,


WELL IT IS HERE IS ANOTHER PROGRAM FOR THE CONVERSION FROM DECIMAL TO BINARY.I HAVE USED A RECURSIVE FUNCTION . ENJOY


REGARDS,
NABEEL




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


void dec(int);


void main()
{
      clrscr();
      int num=0;


      printf("ENTER A DECIMAL NUMBER :\t");
      scanf("%d",&num);


      printf("THE BINARY EQUIVALENT OF %d IS ",num);


      dec(num);
      getch();


}




void dec(int num)
{
      int remainder;


      if(num==1)
      printf("%d",num);


      else
      {
      remainder=num%2;
      num=num/2;
      dec(num);
      printf("%d",remainder);
      }


}

PROGRAM : BINARY TO DECIMAL CONVERSION

ASALAM WALAKUM,

         Well this is a Program to convert a Binary Number input by the user to a Decimal Number. It is a very simple one without an array , which I personally think adds to the efficiency of my Programming skills :D.


Regards,
Nabeel
     
#include<stdio.h>
#include<conio.h>
#include<math.h>


void main()
{
      clrscr();
      int num=0,sum=0,digit=0,temp=0,a=0;


      printf("ENTER A BINARY NUMBER :\t");
      scanf("%d",&num);


      int result=num;


      while(num!=0)
      {
      digit=num%10;
      temp=digit*pow(2,a);
      sum+=temp;
      num=num/10;
      a++;
      }


      printf("THE DECIMAL EQUIVALENT OF %d IS %d ",result,sum);


      getch();


}



Thursday, January 13, 2011

PROGRAM : MATH FUNCTIONS

ASALAM WALAKUM,


   This program consists of some basics math functions for a number . I will add to it in the future .


 Regards
 Nabeel




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


char oddeven(unsigned long);   // FUNCTION PROTOTYPE OF AN ODD & EVEN FUNCTION //
char primcomp(unsigned long);  // FUNCTION PROTOTYPE OF A PRIME & COMPOSITE FUNCTION //
char sumDigits(unsigned long); // FUNCTION PROTOTYPE FOR THE SUM OF DIGITS FUNCTION //
char multiple(unsigned long);  // FUNCTION PROTOTYPE FOR THE FACTORS FUNCTION //


void main()
{


unsigned long num=0;
clrscr();


printf("\n\n\tENTER THE DESIRED NUMBER : ");
scanf("%d",&num);




printf("\n\n\tPLEASE CHOOSE ONE OF THE FOLLOWING AS PER YOUR WISH....\n\n");
printf("\t 1. TO CHECK IF THE NUMBER IS ODD OR EVEN\n");
printf("\t 2. TO CHECK IF THE NUMBER IS PRIME OR COMPOSITE\n");
printf("\t 3. TO CHECK IF THE SUM OF DIGITS OF THE SELECTED NUMBER \n\t\t\tIS ODD OR EVEN\n");
printf("\t 4. TO CHECK THE FACTORS OF THE SELECTED NUMBER \n\t");


switch(getch())
{


  case '1':
  oddeven(num);   // FUNCTION CALL FOR AN ODD & EVEN RECOGNIZATION //
  break;


  case '2':
  primcomp(num);  // FUNCTION CALL FOR A PRIME & COMPOSITE RECOGNIZATION //
  break;


  case '3':
  sumDigits(num);  // FUNCTION CALL FOR THE SUM OF DIGITS FUNCTION //
  break;


  case '4':
  multiple(num);  // FUNCTION CALL FOR THE FACTORS FUNCTION //
  break;
}


getch();


}


char oddeven(unsigned long num) // FUNCTION HEADER FOR AN ODD & EVEN RECOGNIZATION //
{
if (num%2==0)
    return printf("\n\tThe Number %ld is Even.",num);




else
    return printf("\n\tThe Number %ld is Odd.",num);


}


char primcomp(unsigned long num) // FUNCTION HEADER FOR A PRIME & COMPOSITE RECOGNIZATION //
{
unsigned long n=num,result;


for (unsigned long i=2; i<(n-1);i++)
{
   result=num%i;


if (result==0)
     return printf("\n\tThe Number %ld is composite.",num);
}
if (result!=0)
     return printf("\n\tThe Number %ld is prime.",num);


}


char sumDigits(unsigned long num)  // FUNCTION HEADER FOR THE SUM OF DIGITS FUNCTION //
{


unsigned long number=num,digits=0,sum=0;


while(number!=0)
{
      digits=number%10;   // FOR GETTING THE NUMBERS INDIVIDUALLY //
      sum+=digits;
      number=number/10;   /* FOR DELETING THE LAST NUMBER
OR
     FOR GETTING THE NEXT NUMBER */
}


if (sum%2==0)
return printf("\n\tThe Sum of Digits of %ld is Even.",num);


else
return printf("\n\tThe Sum of Digits of %ld is Odd.",num);


      /*
 I HAVE WRITTEN THESE STATEMENTS AGAIN DUE TO THE DIFFERENCE OF
 STATEMENTS IN THE oddeven FUNCTION .
 I COULD HAVE USED THE oddeven FUNCTION INSTEAD OF RE-WRITTING
 THESE STATEMENTS
*/
}


char multiple(unsigned long num)  // FUNCTION HEADER FOR THE SUM OF DIGITS FUNCTION //
{
int table;


printf("\n\n\tDO YOU WANT TO CHECK FOR ONLY ONE TABLE OR MANY....\n\n");
printf("\t1. SINGLE TABLE \n\t2. MANY TABLES");




switch (getch())
{
 case '1':


 printf("\n\nENTER THE TABLE :\t");
 scanf("%d",&table);


  if(num%table==0)
  return printf("\n\tThe Number %ld is a Factor of %d",num,table);


  else
  return printf("\n\tThe Number %ld is NOT a Factor of %d",num,table);




  case '2':


  printf("\n\n\tENTER THE LAST TABLES :\t");
  scanf("%d",&table);


  for(int a=1;a<=table;a++)
  {
if(num%a==0)
printf("%d,",a);
  }


printf("\b are the factors of %ld. ",num);
}






}

Tuesday, December 28, 2010

SOME IMPORTANT LINKS

salam

How are you people out there .... hope you guys are doing great ... well below are some important downloading links for several softwares... ENJOY

INPAGE 3.0
http://www.vijaymukhi.com/documents/books/csbasics/chap1.htm

TO FIND OUT THE CONFIGURATION OF GAMES
www.systemrequirementslab.com


VISUAL STUDIO DOWNLOAD LINK
http://www.microsoft.com/express/Downloads/

if you guys need more links plz reply

Thursday, December 23, 2010

LIST OF LEADERS OF ASIA

Asia

Afghanistan

Ahmad Shah Abdali (1723–1773) unified the Pashtun tribes and founded Afghanistan in 1747. His mausoleum is in Kandahar, Afghanistan, where he is fondly known as Ahmad Shah Baba (Father of Afghanistan).


Azerbaijan

Mammed Amin Rasulzade is the founding father of Azerbaijan. Mehemmed Emin Resulzade (Azerbaijani: Məhəmməd Əmin Axund Hacı Molla Ələkbər oğlu Rəsulzadə, Turkish: Mehmed Emin Resulzâde; 31 January 1884, Novkhana, near Baku — 6 March 1955, Ankara) was an Azerbaijani statesman, scholar, public figure and one of the founding political leaders of Azerbaijan Republic (1918–1920). His expression "Bir kərə yüksələn bayraq, bir daha enməz!" ("The flag once raised will never fall!") has become the motto of the independence movement in Azerbaijan in the 20th century.


Bangladesh

Sheikh Mujibur Rahman, the founding leader of Bangladesh.
Sheikh Mujibur Rahman (1920–1975), is generally considered as the founder of the People's Republic of Bangladesh and was also the first President of Bangladesh. A charismatic politician and popularly called "Bangabandhu" (friend of the Bengal), Mujib's political career featured a struggle for democracy and defiance against military rule in Pakistan. He declared Bangladesh's independence in March 1971[19] immediately after the Pakistan Army began its infamous Operation Searchlight massacre and was subsequently arrested and kept in solitary confinement in West Pakistan throughout the nine-month long bloody war. He was released in January 1972 and returned to Bangladesh to lead the newly independent country.
Mujib's administration would prove to be inept in governing the country wrecked by war and famine. In the mid-night of 15 August 1975, a group of disgruntled army officers brutally killed him along with most of his family members at his private residence in Dhaka.
In an opinion poll conducted by the BBC Bengali service in 2003, he was voted as the greatest Bengali of all times.


Bhutan

Shabdrung Ngawang Namgyal (1594–1651) fled Tibet and unified the fiefdoms of Bhutan. He established the dual system of shared power between secular and Buddhist leadership that continues as a tradition to the present.


Burma

General Aung San is the founding father of Burma (also known as Myanmar). Although he did not live to see the country's independence, he is credited in forming the basic structure of the independence movement and government. Aung San started his political career in 1930 as the editor of Rangoon University's Newspaper – where he accused one of the British administrators of misconduct. In late 1940 he went to Japanese controlled Taiwan and Xiamen to receive military training, and he led the Burmese National Army, spearheading the Japanese invasion of Burma. Later, he switched sides to the Allies, and helped in the Burma Campaign. After the war, he was appointed to the government of a returning British Administration, and was able to negotiate Burma's independence. He helped organized the Panglong Agreement in February 1947, achieving independence for all Burmese territories. However, on Saturday, 19 July 1947, Aung San, along with his cabinet ministers, was assassinated at the secretariat building in Rangoon.


Republic of China

Sun Yat-sen is revered as the "Father of the Country" (國父) in the Republic of China. However, following the Chinese Civil War, the country was split up into two states. The new nations were the modern day People's Republic of China, and the Republic of China, commonly referred to as Taiwan. Mao Zedong is commonly accredited with being the architect of the People's Republic of China. Chiang Kai-shek is accredited with being the first leader of the constitutional Republic of China.


India

Portrait of Gandhi
Mahatma Gandhi (1869–1948) is often referred to as the founding father of India. He was one of the top leaders of the Indian National Congress which struggled for the liberation of India from British ruleJawaharlal Nehru (1889–1964), the first Prime Minister of India and Sardar Vallabhbhai Patel, India's First Deputy Prime Minister, are also considered as founding fathers.[21] It also refers to Dr.Bhimrao Ramji Ambedkar (1891–1956), the architect of the Indian constitution, also an educationist, prominent political figure and India's first law minister. Indian constitution provided constitutional guarantees and protections for a wide range of civil liberties for individual citizens, including freedom of religion, the abolition of untouchability and the outlawing of all forms of discrimination. Ambedkar argued for extensive economic and social rights for yong boy. The Constitution was adopted on 9 August 1949 by the Constituent Assembly.
Although this usage is declining, when used in the plural, as the "Founding fathers" it usually refers to the members of the Constitutional Assembly's Draft Committee. Ironically the Drafting Committee also included women among its ranks.


Indonesia

Soekarno and Mohammad Hatta are the founding fathers of Indonesia. They both signed the Proclamation of Independence which then read by Soekarno, proclaiming the independence of Indonesia from the Netherlands on 17 August 1945. A day later, they were elected respectively as the first President and Vice President of Indonesia. As the Netherlands did not recognize the independece, both of them were prominent figures and were seen as symbol of unity among Indonesian people to fight against Dutch during the National Revolution from 1945 to 1949. In August 1949, Hatta headed a delegation to theHague for a Round Table Conference which then led to the recognition of Indonesian independence by the Netherlands in 23 December 1949.


Iran

Cyrus the Great (600 BC – 530 BC) was the founder of the Persian Empire under the Achaemenid dynasty an empire without precedent—a first world-empire of historical importance[25] and perhaps the most wealthy and magnificent in history.


Korea

Hwanung (환웅;桓雄) and his son Dangun Wanggeom (단군왕검; 檀君王儉) are legendary founders of Gojoseon, the first kingdom of Korea. The founding date is usually calculated as 3 October 2333 BC; 3 October is a South Korean national holiday known as Gaecheonjeol (개천절, 開天節, "Festival of the Opening of Heaven").


Malaysia

Tunku Abdul Rahman (8 February 1903 – 6 December 1990) usually known as "the Tunku" (a princely title in Malaysia), and also called Bapa Kemerdekaan (Father of Independence) or Bapa Malaysia (Father of Malaysia), was Chief Minister of the Federation of Malaya from 1955, and the country's first Prime Minister from independence in 1957. He remained Prime Minister after SabahSarawak, and Singapore joined in 1963 to form Malaysia.


Mongolia

Genghis Khan posthumous portrait
Chinggis Khagan (c.1162–1227), who by uniting the nomadic tribes founded the Mongol Empire, is generally regarded as the father of modern-day Mongolia. Although downcast during the communist-era, Genghis Khan's reputation surged after the democratic revolution in 1990. Modern Mongolia is often called "Genghis's Mongolia".


Pakistan

Muhammad Ali Jinnah, as a young lawyer.
Pakistan's founding father is Muhammad Ali Jinnah (1876–1948), an Indian Muslim Barrister, originally from the Indian National Congress and later theMuslim League, who fought for the rights of Muslim minority in India, is widely held to be the creator of Pakistan. Jinnah is referred to as Quaid-e-Azam or the "Great Leader".
Mr. Jinnah started his career as firmly a secular Indian nationalist and later on was reluctantly converted to the cause of Muslim nationalism through the efforts of Aga Khan III, martyred Prime Minister Liaqat Ali Khan and Poet Philosopher Allama Iqbal all of whom are also revered to a certain extent as founding fathers. Aga Khan was also the founding president of the All India Muslim League.Choudhary Rahmat Ali coined the term Pakistan and is considered the father of the word "Pakistan". Muslim modernist and reformist Sir Syed Ahmed Khan, the founder of Aligarh Educational Movement, is sometimes referred to as the father of the Two-Nation Theory, the basic principle on which Pakistan was founded.

Philippines

Jose Rizal did not live long enough to see the Philippine Declaration of Independence from Spain. or the subsequent defeat of the fledgling government by the United States, but he did play a prominent role in building a sense of national identity in the Philippines. A novelist and a critic, he wrote very influential books, so influential that he was exiled by the Spanish government to the southern Philippine island ofMindanao, and when he left exile, executed, on 30 December 1896. During the Philippine Commonwealth, which was still under the rule of the United States, he was declared the official National Hero of the Philippines and subsequent to Philippine Independence laws were passed requiring courses on Rizal in all secondary schools and colleges.
And Andres Bonifacio is considered as the father of Philippine Revolution. And De Facto national hero and unofficial President of the Philippines


Regards Nabeel   Copyright Wikipedia