eski kodlar silindi ders yeniden
This commit is contained in:
parent
e482e0e22b
commit
c41863ae9d
@ -1,3 +1,7 @@
|
||||
2024-08-10 hwpplayer1 <hwpplayer1@debian>
|
||||
|
||||
* c-basic/C.pdf: Dersler C Temel kursundan itibaren yeniden başlatıldı.
|
||||
|
||||
2024-07-26 hwpplayer1 <hwpplayer1@debian>
|
||||
|
||||
* c-basic/C.pdf: Fonksiyonların Parametre Değişkenleri page 27
|
||||
|
@ -1,14 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
double a, b, c;
|
||||
printf("type your number a:");
|
||||
scanf("%lf", &a);
|
||||
printf("type your number b:");
|
||||
scanf("%lf", &b);
|
||||
c = a + b;
|
||||
printf("c is %f\n", c);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
float f;
|
||||
double d;
|
||||
|
||||
printf("float bir deger giriniz:");
|
||||
scanf("%f", &f);
|
||||
|
||||
printf("double bir deger giriniz:");
|
||||
scanf("%lf", &d);
|
||||
|
||||
printf("f = %f, d = %f\n", f, d);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int foo(){
|
||||
printf("I am foo\n");
|
||||
}
|
||||
|
||||
int main(){
|
||||
foo();
|
||||
return 0;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int a;
|
||||
|
||||
void foo(){
|
||||
a = 10;
|
||||
}
|
||||
|
||||
int main(){
|
||||
a = 20;
|
||||
printf("%d\n", a); // 20
|
||||
foo();
|
||||
printf("%d\n", a); // 10
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int a;
|
||||
|
||||
void foo()
|
||||
{
|
||||
int a;
|
||||
|
||||
a = 10; // yerel a
|
||||
printf("%d\n", a);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
a = 20; // global a
|
||||
printf("%d\n", a); // 20
|
||||
foo(); // 10
|
||||
printf("%d\n", a); // 20
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
printf("hello world in C Programming Language\n");
|
||||
return 0;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a, b;
|
||||
printf("Bir sayi giriniz : ");
|
||||
scanf("%x", &a);
|
||||
printf("a = %d\n", a);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
|
||||
{
|
||||
int b;
|
||||
|
||||
b = 20;
|
||||
a = 10;
|
||||
|
||||
printf("a = %d, b = %d\n", a, b); // geçerli
|
||||
}
|
||||
|
||||
printf("a = %d\n", a); // geçerli
|
||||
// printf("b = %d\n", b); // geçersiz error !!
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a = 100;
|
||||
|
||||
printf("a = %d\n", a);
|
||||
|
||||
{
|
||||
int b;
|
||||
|
||||
b = 20;
|
||||
a = 10;
|
||||
|
||||
printf("a = %d, b = %d\n", a, b); // geçerli
|
||||
}
|
||||
|
||||
printf("a = %d\n", a);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
|
||||
a = 100;
|
||||
|
||||
{
|
||||
int b;
|
||||
|
||||
b = 20;
|
||||
a = 10;
|
||||
|
||||
printf("a = %d, b = %d\n", a, b); // geçerli
|
||||
}
|
||||
|
||||
printf("a = %d\n", a);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int a;
|
||||
|
||||
a = 10;
|
||||
|
||||
printf("%d\n", a);
|
||||
|
||||
{
|
||||
int b;
|
||||
|
||||
b = 30;
|
||||
|
||||
a = 20;
|
||||
printf("a = %d , b = %d\n", a, b);
|
||||
}
|
||||
|
||||
printf("%d\n", a);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,24 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int a;
|
||||
|
||||
a = 10;
|
||||
|
||||
printf("%d\n", a);
|
||||
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
|
||||
a = 40;
|
||||
b = 50;
|
||||
|
||||
printf("a = %d , b = %d\n", a, b);
|
||||
}
|
||||
|
||||
printf("%d\n", a);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a = 10, b = 20;
|
||||
|
||||
printf("a = %d, b = %d\n", a, b); /* a = 10, b = 20 */
|
||||
printf("a = %d, b = %d\n", b, a); /* a = 20, b = 10 */
|
||||
printf("%d%d\n", a, b); /* 1020 */
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int foo()
|
||||
{
|
||||
printf("Foo\n");
|
||||
|
||||
printf("test\n"); /* Reachable code */
|
||||
|
||||
return 100;
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int result;
|
||||
|
||||
result = foo() * 2;
|
||||
printf("%d\n", result);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int foo()
|
||||
{
|
||||
printf("Foo\n");
|
||||
|
||||
printf("test\n"); /* Reachable code */
|
||||
|
||||
return 100;
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int result;
|
||||
|
||||
result = foo() * 2;
|
||||
printf("%d\n", result);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int a;
|
||||
|
||||
printf("enter a number:");
|
||||
scanf("%d", &a);
|
||||
printf("Your number: %d\n", a);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
|
||||
printf("enter two numers a and b:");
|
||||
scanf("%d%d", &a, &b);
|
||||
printf("a = %d, b = %d\n", a, b);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int a;
|
||||
|
||||
a = 100;
|
||||
|
||||
{
|
||||
int a;
|
||||
|
||||
a = 10;
|
||||
printf("%d\n", a); // 10
|
||||
}
|
||||
|
||||
printf("%d\n", a); // 100
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void foo()
|
||||
{
|
||||
printf("foo\n");
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("I am main\n");
|
||||
|
||||
foo();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Fonksiyonun geri dönüş değeri yerine void anahtar sözcüğü yazılırsa bu durum fonksiyonun geri dönüş değerinin
|
||||
olmadığı anlamına gelir. Böyle fonksiyonlara void fonksiyonlar denir. void fonksiyonlarda return kullanılabilir
|
||||
fakat yanına ifade yazılamaz. void fonksiyonlarda return kullanılmamışsa fonksiyon ana blok sonlanınca sonlanır.
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user