Bubble Sort


#include
#include
#define MAX 50
/*
Bubble Sort
*/
void bubblesort(int array[], int size) {

int i,j;

for(i=0;i less than size;i++) {
for(j=1;j less than size-i;j++) {
if(array[j-1]>array[j]) {
int temp=array[j];
array[j]=array[j-1];
array[j-1]=temp;
}
}
}
}

int main() {

int array[MAX],size;
int i;
printf("Diziniz kac elemanli: ");
scanf("%d",size);
printf("Lutfen dizinin elemanlarini giriniz:\n");
for(i=0;i less than size;i++) {
scanf("%d",array[i]);
}

bubblesort(array,size);

for(i=0;i less than size;i++) {
printf("%d ",array[i]);
}

return 0;
}

Football League Decision Making Mechanism


#include
#include
/*When a football team's 10-week match statistics are entered, the program that determines whether that team will stay in the league or not.
A minimum of 12 points is required to stay in the league.
Victory 3,
Draw 1,
Defeat 0 points.
*/

int main() {

int istatistik[10]={2,0,1,1,2,0,0,2,1,0};
int puan=0;
int i;

for(i=0;i less than or equal to 10;i++) {
if(istatistik[i]==2) {
puan=puan+3;
}
else if (istatistik[i]==1) {
puan=puan+1;
}
else if (istatistik[i]==0) {
puan=puan+0;
}
}

if(puan>=12) {
printf("Takim ligi gecmistir. :)";
}
else if(puan less than or equal to 12) {
printf"Takim ligi gecememistir. :(");
}

return 0;
}

Flight Company Hand Luggage Calculation


Flight Company Hand Luggage Calculation

Call By Value (Pointers)


Call By Value (Pointers)

Parking Fee Calculator


Parking Fee Calculator

Maximum Number Finder


Maximum Number Finder

Pointers


Pointers

Prime Number Detection Function


Prime Number Detection Function