Compare commits

..

28 Commits

Author SHA1 Message Date
7e3fed1bd5
hex_scan code back 2025-04-12 23:13:13 +03:00
56fa9fee35
make clean 2025-04-12 22:59:25 +03:00
92130c44dc
hello with make 2025-04-12 22:58:04 +03:00
97d77a3ff6
changed code removed main from each file 2025-04-12 22:53:01 +03:00
9a2eabf5cf
new makefile fix 2025-04-12 22:37:32 +03:00
11abe9c6c7
new makefile 2025-04-12 22:35:42 +03:00
d6283d31cd
new file = main.c and modified hex_read_scanf.c removed main from hex_read_scanf.c 2025-04-12 22:29:04 +03:00
0bb57da7ec
first code 2025-04-12 22:12:51 +03:00
79f83aa190
int main() {
unsigned int a; // Change 'int' to 'unsigned int'

    printf("Enter your number: ");
    scanf("%x", &a); // Now 'a' matches '%x' expected type
    printf("a = %u\n", a); // Use '%u' to correctly print an unsigned int

    return 0;
}
2025-04-12 22:09:27 +03:00
523764a45c
fixed makefile 2025-04-12 22:07:23 +03:00
119632d026
make file test 2025-04-12 22:06:03 +03:00
84c1aa6a02
changed code to the older version 2025-04-12 22:02:46 +03:00
c788fa919f
unsigned int fix 2025-04-12 21:58:40 +03:00
70b12c1d28
trying to understand and fix the issue hex read scanf 2025-04-12 21:56:49 +03:00
391e29cbfd
test for ci/cd 2025-04-12 21:51:02 +03:00
da1d77758a
Float and Double changed the name 2025-04-12 21:41:00 +03:00
7b90c42e43
double and float 2025-04-12 21:39:46 +03:00
2255d2f5ca
printf fonksiyonunda hem float hem de double türleri %f ile yazdırılır. Ancak scanf fonksiyonunda float %f ile,
double %lf ile okunur. Örneğin: sayfa 21
2025-03-21 13:11:44 +03:00
ffca2a7d25
hex read scanf example 2025-03-21 13:10:07 +03:00
dcf7552add
ChangeLog update 2025-03-18 14:41:21 +03:00
9ad88016bb
scanf two numbers 2025-03-18 14:39:40 +03:00
1d24d8b71c
scanf example 2025-03-18 14:29:06 +03:00
6b0ac54b46
print examples 2025-03-18 14:21:16 +03:00
c55c2c7c8b
print example 2025-03-18 14:12:50 +03:00
f202be858b
foo example 2025-03-18 14:06:43 +03:00
b8f22cf5bd
toplama örneği 2025-03-18 14:02:23 +03:00
9ff74b5bf4
hello world example / 2025 examples 2025-03-18 13:58:35 +03:00
6de7b78d91
2025-examples 2025-03-18 13:39:41 +03:00
24 changed files with 151 additions and 13431 deletions

8
.woodpecker/build.yaml Normal file
View File

@ -0,0 +1,8 @@
when:
- event: [push, pull_request, manual]
steps:
- name: build
image: masscollabs/build-essential:latest
commands:
- make

View File

@ -1,3 +1,14 @@
2025-03-21 Mert Gör <mertgor@masscollabs.xyz>
* c-basic/CSD-C-Basic-Book/C.pdf: printf fonksiyonunda hem float hem de double türleri %f ile yazdırılır. Ancak scanf fonksiyonunda float %f ile,
double %lf ile okunur. Örneğin: sayfa 21
2025-03-18 Mert Gör <mertgor@masscollabs.xyz>
* c-basic/CSD-C-Basic-Book/C.pdf: sayfa 21 printf fonksiyonundaki format karakterleri scanf fonksiyonunda klavyeden girişi belirlemektedir. Yani örneğin biz
pir int değeri printf ile %x kullanarak yazdırırsak bu değer 16'lık sistemde ekrana yazdırılır. Fakat bir int değeri
scanf ile %x ile okumak istersek klavyeden yaptığımız girişin 16'lık sistemde olduğu kabul edilir. Örneğin:
2025-03-08 Mert Gör <mertgor@masscollabs.xyz>
* UNIX-Linux/Unix-Linux-SysProg.pdf: Hızlıca incelendi sayfa 126

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
CC = gcc
CFLAGS = -Wall -Wextra -std=c11
SRCDIR = ./c-basic
SRC = $(wildcard $(SRCDIR)/*.c)
OBJ = $(patsubst $(SRCDIR)/%.c, $(SRCDIR)/%.o, $(SRC))
TARGET = main
all: $(TARGET)
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^
$(SRCDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJ) $(TARGET)

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
1 - What is UNIX ? What does it mean ?
https://en.wikipedia.org/wiki/Unix
https://en.wikipedia.org/wiki/Unix#:~:text=In%201970%2C%20the%20group%20coined,of%20the%20final%20spelling%20Unix.
2 - When was the first UNIX developed and which hardware was the first platform for the UNIX.
https://en.wikipedia.org/wiki/History_of_Unix
https://www.britannica.com/technology/UNIX
https://www.redhat.com/en/blog/unix-linux-history
3 - What is B programming language and also C programming language ?
https://en.wikipedia.org/wiki/B_(programming_language)
https://en.wikipedia.org/wiki/C_(programming_language)
4 - What is a "personal computer"(PC) ?
https://en.wikipedia.org/wiki/Personal_computer
Merhaba arkadaşlar
Bugünkü çalışmamızda kaynak toplama hakkında nasıl yol alabileceğimizi göstermek istiyorum.
Kaan Aslan hocamız C dilini UNIX işletim sistemiyle bağlantılı olarak anlatmış ve UNIX işletim sisteminin doğuşu ile bağlantılı olarak tasvir etmiştir.
Wikipedia ve diğer kaynaklardan yararlanıp bilgilerimizi zenginleştireceğiz.
Teşekkürler.

View File

@ -1,12 +0,0 @@
#include <stdio.h>
int main(int argc, char *argv[])
{
int i;
for (i = 0; i < argc; ++i)
printf("%s\n", argv[i]);
return 0;
}

View File

@ -1,27 +0,0 @@
#include <stdio.h>
#include <ncurses.h>
int main(void)
{
char ch;
do
{
printf("(e)vet/(h)ayir?");
ch = getch();
printf("%c\n", ch);
} while (ch != 'e' && ch != 'h');
if (ch == 'e')
printf("evet secildi\n");
else
printf("hayir secildi\n");
return 0;
}

View File

@ -1,16 +0,0 @@
#include <stdio.h>
int main()
{
double a,b,c;
printf("enter double number a:\n");
scanf("%lf", &a);
printf("enter double number b:\n");
scanf("%lf", &b);
c = a + b;
printf("%f", c);
return 0;
}

17
c-basic/float_double.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
int my_float()
{
float f;
double d;
printf("float :");
scanf("%f", &f);
printf("double :");
scanf("%lf", &d);
printf("f = %f, d = %f", f, d);
return 0;
}

8
c-basic/foo.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
int foo()
{
printf("I am foo\n");
return 0;
}

View File

@ -1,11 +0,0 @@
#include <stdio.h>
int main(void){
int i;
for (i = 0; i < 10; ++i)
printf("%d\n", i);
return 0;
}

View File

@ -1,8 +1,8 @@
#include <stdio.h>
int main()
int hello()
{
printf("Hello World !\n");
printf("Hello C Programming Language 2025 Examples\n");
return 0;
}

15
c-basic/hex_read_scanf.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
int hex_scan()
{
int a;
printf("Enter a number : ");
scanf("%x", &a);
printf("a = %d\n", a);
return 0;
}

16
c-basic/main.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
#ifndef HEX_READ_SCANF_H
#define HEX_READ_SCANF_H
extern void hex_scan();
#endif // HEX_READ_SCANF_H
int main()
{
hex_scan();
return 0;
}

12
c-basic/print_example.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
int print_example()
{
int a = 10, b = 20;
printf("a = %d, b = %d\n", a, b);
printf("a ? = %d, b ? = %d\n", b , a);
printf("%d%d\n", a, b);
return 0;
}

View File

@ -0,0 +1,20 @@
#include <stdio.h>
int print_with_scan()
{
int a , b ;
printf("enter a number\n");
scanf("%d", &a);
printf("enter b number\n");
scanf("%d", &b);
printf("a is %d\n", a);
printf("b is %d\n", b);
printf("a is %d b is %d\n", a, b);
printf("b is %d a is %d\n", b, a);
return 0;
}

View File

@ -1,12 +0,0 @@
#include <stdio.h>
#include <ncurses.h>
int main()
{
char ch;
while ((ch = getch()) != 'q')
putchar(ch);
return 0;
}

12
c-basic/scanf_example.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
int my_scan()
{
int a;
printf("enter the a number:");
scanf("%d", &a);
printf("a number is : %d\n", a);
return 0;
}

View File

@ -1,15 +0,0 @@
#include <stdio.h>
int main()
{
int a;
int b;
printf("Enter number a:\n");
scanf("%d", &a);
printf("Enter number b:\n");
scanf("%d", &b);
printf("a = %d, b = %d\n", a, b);
return 0;
}

View File

@ -1,12 +1,12 @@
#include <stdio.h>
int main()
int scan_two_numbers()
{
int a;
int b;
int a, b;
printf("Enter two numbers:\n");
printf("enter two numbers:");
scanf("%d%d", &a, &b);
printf("a = %d, b = %d\n", a, b);
return 0;

13
c-basic/toplama.c Normal file
View File

@ -0,0 +1,13 @@
#include <stdio.h>
int addition()
{
int a , b , c;
a = 10;
b = 20;
c = a + b;
printf("C = %d", c);
return 0;
}

View File

@ -1,12 +0,0 @@
#include <stdio.h>
int main()
{
int i = 0;
while (i < 10) {
printf("%d\n", i);
++i;
}
return 0;
}

View File

@ -1,13 +0,0 @@
#include <stdio.h>
int main(void)
{
int i = 10;
while (i) {
printf("%d\n", i);
--i;
}
return 0;
}

BIN
main Executable file

Binary file not shown.