printf example rewritten
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Mert Gör 🇹🇷 2025-06-17 13:10:20 +03:00
parent bde2e44f89
commit dc07b91a12
Signed by: mertgor
GPG key ID: D200B456637BC4F3
3 changed files with 22 additions and 8 deletions

View file

@ -1,7 +1,13 @@
#include <stdio.h> #include <stdio.h>
#include "hello.h" #include "print_example.h"
int main() { int main() {
hello();
print_example();
return 0; return 0;
} }
/**
gcc main.c print_example.c -o print_example
**/

View file

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

8
c-basic/print_example.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef PRINT_EXAMPLE_H
#define PRINT_EXAMPLE_H
#include <stdio.h>
int print_example();
#endif