Saturday, December 24, 2011

C Program to demonstrate the use of static variables

#include<stdio.h>
#incl.ude<conio.h>
void stat();
void main()
{
    int c;
    clrscr();
     for(c=1;c<=3;c++)
     stat();
     getch();
}

void stat()
{
  static int sv=0;
  sv=sv+1;
  printf("%d\n",sv);
}

Thursday, December 15, 2011

C Program to find Hcf and Lcm Of numbers

int hcf(int n, int m) 

 
    int temp; 
    while( m > 0) 

        temp = n; 
        n = m; 
        m = temp % m; 
    } 
    return n; 

 
int lcm(int n, int m) { 
    int product = n*m; 
    int hcf = hcf(n,m); 
    int lcm = product/hcf; 
    return lcm; 

int main() 

    int n, m; 
    scanf("%d%d",&n,&m); 
    printf("%d\n",lcm(n,m)); 
    return 0; 
}
Mr. Denis Ritchie was found dead on October 12, 2011, at the age of 70 at his home in Berkeley Heights, New Jersey, where he lived alone. First news of his death came from his former colleague, Rob Pike. The cause and exact time of death have not been disclosed. He had been in frail health for several years following treatment for prostate cancer and heart disease. His death came a week after the death of Steve Jobs, although Ritchie's death did not receive as much media coverage.Computer historian Paul E. Ceruzzi said after his death: " Ritchie was under the radar. His name was not a household name at all, but... if you had a microscope and could look in a computer, you'd see his work everywhere inside.

!!.... Hats Off to One of the GEMS of the Computer World....!!
.....May his Soul REST IN PEACE...................