Search

Dennis MacAlistair Ritchie the Creator of C Language

1 comments

Born
September 9, 1941(1941-09-09)Bronxville, New York, U.S.
Died
found dead October 12, 2011(2011-10-12) (aged 70)
Berkeley Heights, New Jersey, U.S.
Fields
Computer science
Institutions
Lucent TechnologiesBell Labs
Alma mater
Harvard University
Known for
ALTRANBBCPLCMulticsUnix
Notable awards
Turing AwardNational Medal of Technology

Dennis MacAlistair Ritchie (b. September 9, 1941; found dead October 12, 2011), was an American computer scientist who "helped shape the digital era." He created the C programming language and, with long-time colleague Ken Thompson, the UNIX operating system. Ritchie and Thompson received the Turing Award from the ACM in 1983, the Hamming Medal from the IEEE in 1990 and the National Medal of Technology from President Clinton in 1999. Ritchie was the head of Lucent Technologies System Software Research Department when he retired in 2007. He was the 'R' in K&R C and commonly known by his username dmr.


Background
Ritchie was born in Bronxville, New York. His father was Alistair E. Ritchie, a longtime Bell Labs scientist and co-author of The Design of Switching Circuits on switching circuit theory. He moved with his family to Summit, New Jersey, as a child, where he graduated from Summit High School.
Ritchie graduated from Harvard University with degrees in physics and applied mathematics. In 1967, he began working at the Bell Labs Computing Sciences Research Center, and in 1968, he received a PhD from Harvard under the supervision of Patrick C. Fischer, his doctoral dissertation being "Program Structure and Computational Complexity".

C and Unix
Ritchie was best known as the creator of the C programming language, a key developer of the UNIX operating system, and co-author of The C Programming Language, and was the 'R' in K&R (a common reference to the book's authors Kernighan and Ritchie). Ritchie worked together with Ken Thompson, the scientist credited with writing the original Unix; one of Ritchie's most important contributions to Unix was its porting to different machines and platforms. The C language is widely used today in application, operating system, and embedded system development, and its influence is seen in most modern programming languages. UNIX has also been influential, establishing concepts and principles that are now precepts of computing.
Ritchie was elected to the National Academy of Engineering in 1988 for "development of the 'C' programming language and for co-development of the UNIX operating system."


Awards

Turing Award
In 1983, Ritchie and Thompson jointly received the Turing Award for their development of generic operating systems theory and specifically for the implementation of the UNIX operating system. Ritchie's Turing Award lecture was titled "Reflections on Software Research".

IEEE Richard W. Hamming Medal
In 1990, both Ritchie and Thompson received the IEEE Richard W. Hamming Medal from the Institute of Electrical and Electronics Engineers (IEEE), "for the origination of the UNIX operating system and the C programming language".


Fellow of the Computer History Museum
In 1997, both Ritchie and Thompson were made Fellows of the Computer History Museum, "for co-creation of the UNIX operating system, and for development of the C programming language."


National Medal of Technology
Thompson (left) and Ritchie (center) receiving the National Medal of Technology from President Clinton in 1999. On April 21, 1999, Thompson and Ritchie jointly received the National Medal of Technology of 1998 from President Bill Clinton for co-inventing the UNIX operating system and the C programming language which, according to the citation for the medal, "led to enormous advances in computer hardware, software, and networking systems and stimulated growth of an entire industry, thereby enhancing American leadership in the Information Age".

Japan Prize
In 2011, Ritchie, along with Thompson, was awarded the Japan Prize for Information and Communications for his work in the development of the Unix operating system.

My Project using file handling in C

6 comments

#include
#include
#include

char log,sign,a;
int x,c,m,z[20];
int choice;

int main()
{

char pass[30];
char filename[30];
int balik=1;
char line1[20];
char line2[20];
char line3[20];
char line4[20];
char line5[20];
char line6[20];
int code;
char fid[20];
char fpass[20];
FILE *f;


printf("sign-in to YAHOOMAIL!\n");
printf("you are protected\n\n");
system("pause");


while(balik==1)
{
printf("enter ID:");
gets(filename);
///1
if((f=fopen(filename,"r"))!=NULL)
{
printf("error! ID exist!\n");

balik=1;
}

///1
else
{
///2
if((f=fopen(filename,"w"))==NULL)
{
printf("error ID\n");
balik=1;
}
//2
else
{


//information center

f=(fopen(filename,"w"));
printf("last name:");
gets(line1);
fprintf(f,"last name:%s\n\n",line1);


printf("first name:");
gets(line2);
fprintf(f,"first name:%s\n\n",line2);


printf("middle name:");
gets(line3);
fprintf(f,"middle name:%s\n\n",line3);


printf("age:");
gets(line4);
fprintf(f,"age:%s\n\n",line4);


printf("gender:");
gets(line5);
fprintf(f,"gender:%s\n\n",line5);


printf("Email Address:");
gets(line6);
fprintf(f,"Email Address:%s\n\n",line6);
fclose(f);

printf("PASSWORD:");
scanf("%s",pass);
f=(fopen(pass,"a"));
fclose(f);

ret:
printf("\n\nJust a couple more details...\n Type the code shown\n\n");
printf("do not input character!\n\n");
printf(" __________________\n");
printf("| |\n");
printf("| 2253028 |\n");
printf("|__________________|\n\n");


printf("type the codes:");
scanf("%d",&code);
///3
switch (code)

{
///3
case 2253028:
printf("\n\nsuccessfully signed\n\n");
system("pause");
goto alog;
///3
case 2:
printf("error");
system("cls");
goto ret;
///3
default:
system("cls");
goto ret;
}
alog:
system("cls");
for (m=0;m<=44;m++)
printf("%d",m);

printf("\n\n\n\n\n\n\n\n\n\n\n\t\t\t\tlog-in?[y/n]:");
scanf("%s",&log);
///4
switch (log)
{
///4
case 'y':
{
final:
system("cls");

printf("enter ID:");
scanf("%s",fid);
printf("enter PASSWORD:");
scanf("%s",fpass);
///5
if ((strcmp(fid,filename)==0)&&(strcmp(fpass,pass)==0))
{

main:
system("cls");

printf("\n\n\n\n\n view account[1]\n\n");
printf("military time [2]\n\n");
printf("log-out [3]\n\n\n\n\n");
printf("enter your choice:");
scanf("%d",&choice);

switch (choice)
{
case 1:
{

system("cls");
f=(fopen(filename,"r"));
fgets(line1,20,f);
fgets(line2,20,f);
fgets(line3,20,f);
fgets(line4,20,f);
fgets(line5,20,f);
fgets(line6,20,f);


printf("your account:\n\n");
puts(line1);
puts(line2);
puts(line3);
puts(line4);
puts(line5);
puts(line6);

system("pause");

goto main;
break;

}
case 2:
{
system("cls");




printf("enter your name:");
scanf("%s",z);





printf("hello %s have fun! enjoy...\n\n",z);

printf("enter your military time:");
scanf("%d",&x);
/*ACAS ARNEL M.*/

if(x==1300)
{
printf("1:00 pm");
system("cls");
system("pause");
goto main;
}
if((x>=1301)&&(x<=1399))
{
c=x-1300;
printf("1:%dpm",c);
system("pause");
goto main;
}
if(x==1400)
{
printf("2:00 pm");
system("pause");
goto main;
}
if((x>=1401)&&(x<=1499))
{
c=x-1400;
printf("2:%d pm",c);
system("pause");
goto main;
}
if(x==1500)
{
printf("3:00 pm");
system("pause");
goto main;
}
if((x>=1501)&&(x<=1599))
{
c=x-1500;
printf("3:%d pm",c);
system("pause");
goto main;
}
if(x==1600)
{
printf("4:00 pm");
system("pause");
goto main;
}
if((x>=1601)&&(x<=1699))
{
c=x-1600;
printf("4:%d pm",c);
system("pause");
goto main;
}
if(x==1700)
{
printf("5:00 pm");
system("pause");
goto main;
}
if((x>=1701)&&(x<=1799))
{
c=x-1700;
printf("5:%d pm",c);
system("pause");
goto main;
}
if(x==1800)
{
printf("6:00 pm");
system("pause");
goto main;
}
if((x>=1801)&&(x<=1899))
{
c=x-1800;
printf("6:%d pm",c);
system("pause");
goto main;
}
if(x==1900)
{
printf("7:00 pm");
system("pause");
goto main;
}
if((x>=1901)&&(x<=1999))
{
c=x-1900;
printf("7:%d pm",c);
system("pause");
goto main;
}
if(x==2000)
{
printf("8:00");
system("pause");
goto main;
}
if((x>=2001)&&(x<=2099))
{
c=x-2000;
printf("8:%d pm",c);
system("pause");
goto main;
}
if(x==2100)
{
printf("9:00 pm");
system("pause");
goto main;
}
if((x>=2101)&&(x<=2199))
{
c=x-2100;
printf("9:%d pm",c);
system("pause");
goto main;
}
if(x==2200)
{
printf("10:00 pm");
system("pause");
goto main;
}
if((x>=2201)&&(x<=2299))
{
c=x-2200;
printf("10:%d pm",c);
system("pause");
goto main;
}
if(x==2300)
{
printf("11:00 pm");
system("pause");
goto main;
}
if((x>=2301)&&(x<=2399))
{
c=x-2300;
printf("11:%d pm");
system("pause");
goto main;
}
if(x==2400)
{
printf("12:00 pm");
system("pause");
goto main;
}
if((x>=2401)&&(x<=2499))
{
c=x-2400;
printf("12:%d pm",c);
system("pause");
goto main;
}


if(x==100)
{
printf("1:00 am");
system("pause");
goto main;
}
if((x>=101)&&(x<=199))
{
c=x-100;
printf("1:%d am",c);
system("pause");
goto main;
}
if(x==200)
{
printf("2:00 am");
system("pause");
goto main;
}
if((x>=201)&&(x<=299))
{
c=x-200;
printf("2:%d am",c);
system("pause");
goto main;
}
if(x==300)
{
printf("3:00 am");
system("pause");
goto main;
}
if((x>=301)&&(x<=399))
{
c=x-300;
printf("3:%d am",c);
system("pause");
goto main;
}
if(x==400)
{
printf("4:00 am");
system("pause");
goto main;
}
if((x>=401)&&(x<=499))
{
c=x-400;
printf("4:%d am",c);
system("pause");
goto main;
}
if(x==500)
{
printf("5:00 am");
system("pause");
goto main;
}
if((x>=501)&&(x<=599))
{
c=x-500;
printf("5:%d am",c);
system("pause");
goto main;
}
if(x==600)
{
printf("6:00 am");
system("pause");
goto main;
}
if((x>=601)&&(x<=699))
{
c=x-600;
printf("6:%d am",c);
system("pause");
goto main;
}
if(x==700)
{
printf("7:00 am");
system("pause");
goto main;
}
if((x>=701)&&(x<=799))
{
c=x-700;
printf("7:%d am",c);
system("pause");
goto main;
}
if(x==800)
{
printf("8:00 am");
system("pause");
goto main;
}
if((x>=801)&&(x<=899))
{
c=x-800;
printf("8:%d am",c);
system("pause");
goto main;
}
if(x==900)
{
printf("9:00 am");
system("pause");
goto main;
}
if((x>=901)&&(x<=999))
{
c=x-900;
printf("9:%d am",c);
system("pause");
goto main;
}
if(x==1000)
{
printf("10:00 pm");
system("pause");
goto main;
}
if((x>=1001)&&(x<=1099))
{
c=x-1000;
printf("10:%d am");
system("pause");
goto main;
}
if(x==1100)
{
printf("11:00 am");
system("pause");
goto main;
}
if((x>=1101)&&(x<=1199))
{
c=x-1100;
printf("11:%d am",c);
system("pause");
goto main;
}
if(x==1200)
{
printf("12:00 pm");
system("pause");
goto main;
}
if((x>=1201)&&(x<=1299))
{
c=x-1200;
printf("12:%d pm",c);
system("pause");
goto main;
}
else
{
printf("error input! guys....\n\n\n\n");
system("pause");
goto main;
return 0;
}


goto main;
}
case 3:
{
system("cls");
printf("\n\n\nsuccessfully log-out!");

return 0;
}
default:
{
goto main;
}
}














}
///5
else
{
system("cls");
printf("user no register!\n\n");
goto final;
}

break;
}
///4
case 'n':
{
printf("bye bye.... see you soon!");
break;
}
///4
default:
{
goto alog;
}

}






















//f=(fopen("password.txt","w"));
// printf("PASSWORD:");
// scanf("%s",filename);
// fclose(f);



// f=(fopen(filename,"r"));
// fgets(line,500,f);
// printf("the line you enter:");
// puts(line);

break;
}
}
}
return 0;
}

converts text into binary using the division method through ASCII code

0 comments

#include
using namespace std;
#include
#include

char *entry, letter, choice[2];
int ascii, len, binary[8], total;
void prog();

int main()
{
prog();
return 0;
}

void prog()
{
entry = new char[501];
/* entry should be dynamic, otherwise a new
string entry of 501 chars would be created
each time function is called!
Talk about memory hog! */
cout<<"Enter string to convert (up to 500 chars): "; cin.getline(entry, 500); len = strlen(entry); /* get the number of characters in entry. */ /* this loop is executed for each letter in the string. */ for(int i = 0; i0) /* This while loop converts the ASCII # into binary,
stores it backwards into the binary array. */
{
/* To get the binary code one must take the decimal number in
question, take it and divide it by two repeatedly, save
the remainder (which will become the binary number), save
the whole number, divide by two, and repeat the whole
process until 0 is reached. This if-else statement serves
this functionality, by getting the remainder of the ascii
code, storing it in the array and then dividing the int
ascii by two */
if((ascii%2)==0)
{
binary[total] = 0;
ascii = ascii/2;
total++; /* increasing by one each time will yeild the
number of numbers in the array. */
}
else
{
binary[total] = 1;
ascii = ascii/2;
total++;
}
}
total--; /* due to data type factors, the program will actually
add a 0 at the end of the array that is not supposed
to be there, decrementing total will solve this
problem, as that 0 will not be displayed. */
/* this while loop displays the binary code for that letter. */
while(total>=0)
{
cout<
total--;
}
}
delete[] entry; /* free up the memory used by entry */
cout<<<"Do again(1 = yes, 2= no)?: ";
cin.getline(choice,3);
if(choice[0] == '1')
prog(); /* program is recursive, it calls itself. It's kinda
like a function loop of sorts. */
else
exit(0); /* quits the program */
}

Factorial Permutation and Combination in C

0 comments

#include

int factor (int num)
{
if (num>1)
{
return (num * factor(num-1));
}
else{}
return (1);
}

int main(void)
{

int 1num,2num,permdin,permfact;
int den,comdin,comfact,sub1,sub2;

printf("Enter First Number:");
scanf("%d",&1num);
printf("%d = %d \n\n\n\n\n\n\n",1num,factor(1num));
printf("Enter Second Number:");
scanf("%d",&2num);
printf("%d = %d \n\n",2num,factor(2num));

if(1num>2num)
{
sub1=1num-2num;
permdin=factor(sub1);
permfact=(factor(1num)/permdin);
printf("Permutation = %d\n\n",permfact);



printf( "Combination : %d",factor(1num) / (factor(2num)* factor(1num-2num)));



printf("\n\n\n");
}
else
{
printf("Invalid:\n\n");

}
return 0;
}

Calloc in C

0 comments

/* SAGpa Sa bala Kan-a */
#include
#include

int main ()
{
int i,n;
int * pData;
printf ("Amount of numbers to be entered: ");
scanf ("%d",&i);
pData = (int*) calloc (i,sizeof(int));
if (pData==NULL) exit (1);
for (n=0;n
{
printf ("Enter number #%d: ",n);
scanf ("%d",&pData[n]);
}
printf ("You have entered: ");
for (n=0;n
free (pData);
return 0;
}