Created
November 13, 2017 22:28
-
-
Save GokselKUCUKSAHIN/2b9c4aa095da9912e6b2f6e60d33eb01 to your computer and use it in GitHub Desktop.
C-Programlama I (Project_10-20)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int N,i=1,f=1; | |
printf("Kac faktoriyel hesaplancak -> "); scanf("%d",&N); | |
while (i<=N) | |
f*=i++; | |
printf("%d!=%d faktoriyel\n",N,f); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int a=0,b=0,c=0; | |
int g=0,k=0,s=0; | |
for(a=0;a<=10;a=a+1) | |
{ | |
printf("SAYI GIRISI -> "); | |
scanf("%d",&c); | |
if (c < 0) | |
{ | |
printf("%d Sayisi Negatif\n",c); | |
g++; | |
b++; | |
} | |
else if (c == 0) | |
{ | |
printf("%d Sayisi Sifir\n",c); | |
k++; | |
b++; | |
} | |
else | |
{ | |
printf("%d Sayisi Pozitif\n",c); | |
s++; | |
b++; | |
} | |
if (a == 10) | |
{ | |
printf("%d tane Pozitif, %d tane Sifir, %d tane Negatif sayi girdiniz\n",s,k,g); | |
break; | |
} | |
} | |
return 0; | |
} | |
/* | |
kaç tanesi prozit | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ int sayi,i,p=0,n=0,s=0; | |
for(i=1; i<=10; i++) | |
{ printf("%d. sayiyi giriniz -> ",i); | |
scanf("%d",&sayi); | |
if(sayi==0) | |
s++; | |
else if (sayi<0) | |
n++; | |
else | |
p++; | |
} | |
printf("\n\nN:%d, S:%d, P:%d\n\n",n,s,p); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int i,j; | |
for(i=8;i>=1; i--) | |
{ | |
for(j=i;j>=1;j--) | |
printf("%3d",j); | |
printf("\n"); | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
int main(void) | |
{ | |
int limit,i,j,asal; | |
printf("Kaca kadar olan sayilar incelenecek -> "); scanf("%d",&limit); | |
for(i=1;i<=limit;i++) | |
{ | |
asal=1; | |
for(j=2;j<=sqrt(i);j++) | |
{ | |
if (i%j==0) | |
{ | |
asal=0;break; | |
} | |
} | |
if (asal==0) | |
{ | |
//printf("%d Asal degildir.\n",i); | |
} | |
else | |
{ | |
if (i >= 2) | |
printf("%d Asaldir.\n",i); | |
} | |
} | |
system("PAUSE"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void main() | |
{ | |
int x,toplam=0; | |
for(x=2;x<=30;x+=2) | |
toplam+=x; | |
printf("2 ile 30 sayilari arasindaki cift tamsayilarin toplami : %d\n",toplam); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int kisi,hesapNo,oncekiKrediLimiti,ilkBakiye,yeniKrediLimiti; | |
for(kisi=1;kisi<=3;kisi++) | |
{ | |
printf("%d. musterinin hesap numarasini giriniz:",kisi); | |
scanf("%d",&hesapNo); | |
printf("%d. musterinin onceki kredi limitini giriniz:",kisi); | |
scanf("%d",&hesapNo); | |
printf("%d. musterinin su andaki bakiyesini giriniz:",kisi); | |
scanf("%d",&ilkBakiye); | |
yeniKrediLimiti=oncekiKrediLimiti/2; | |
if(ilkBakiye <= yeniKrediLimiti) | |
printf("\n"); | |
else | |
printf(" %d. musteri yeni kredi limitini asmistir\n\n",kisi); | |
} | |
system("PAUSE"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int i,j,toplam=0; | |
printf("Kaca kadar olan sayilarin toplamini istiyorsunuz?: "); scanf("%d",&i); | |
for(j=0;j<=i;j++) | |
toplam+=j; | |
printf("Sonuc. %d\n",toplam); | |
system("PAUSE"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int x; | |
for(x=5;x<15;x+=1){ | |
if (x==8) | |
break; | |
printf("Break dongude, x in degeri simdi %d\n",x); | |
} | |
for (x=5;x<15;x+=1){ | |
if(x==8) | |
continue; | |
printf("Continue dongude, x in degeri simdi %d\n",x); | |
} | |
system("PAUSE"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int tahmin,min,max; | |
char cevap; | |
min = 0; | |
max = 100; | |
do{ | |
tahmin=(max-min)/2+min; | |
printf("Tuttugun sayi bu mu?: %d\nBuyuk(B),Kucuk(K),Esit(E): ",tahmin); scanf("%c",&cevap); | |
if(cevap=='K'){ | |
min=tahmin+1; | |
} | |
if(cevap=='B'){ | |
max=tahmin-1; | |
} | |
} | |
while(cevap != 'E'); | |
//SADECE WHILE ILE YAZILIRSA^^ | |
/*int a=1; | |
while(a==1){ | |
tahmin=(max-min)/2+min; | |
printf("Tuttugun sayi bu mu?: %d\nBuyuk(B),Kucuk(K),Esit(E): ",tahmin); scanf("%c",&cevap); | |
if(cevap=='K'){ | |
min=tahmin+1; | |
} | |
if(cevap=='B'){ | |
max=tahmin-1; | |
} | |
if(cevap=='E'){ | |
a=0; | |
} | |
}*/ | |
printf("Cevabi Buldum\n"); | |
system("PAUSE"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
17/10/2017~~14/11/2017