#include <stdio.h>
/* bu çok satırlı
yorum satırları*/
// bu ise tek satırlı yorum satırı
int main(int argc, char *argv[]) {
printf("Merhaba dunya!");
return 0;
}
Merhaba dunya!
#include <stdio.h>
/* bu çok satırlı
yorum satırları*/
// bu ise tek satırlı yorum satırı
int main(int argc, char *argv[]) {
printf("Merhaba dunya!");
printf("Merhaba dunya!");
return 0;
}
Merhaba dunya!Merhaba dunya!
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Merhaba dunya!\n");
printf("Merhaba dunya!");
return 0;
}
Merhaba dunya!
Merhaba dunya!
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Merhaba dunya!\n");
printf("\nMerhaba dunya!");
return 0;
}
Merhaba dunya!
Merhaba dunya!
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Merhaba dunya!\n\n\n");
printf("Merhaba dunya!");
return 0;
}
Merhaba dunya!
Merhaba dunya!
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Merhaba dunya!\n\n\nMerhaba dunya!");
printf("Merhaba dunya!");
return 0;
}
Merhaba dunya!
Merhaba dunya!Merhaba dunya!
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Merhaba dunya!\n");
printf("\tMerhaba dunya!\n");
printf("\t\tMerhaba dunya!\n");
printf("\tMerhaba dunya!\n");
return 0;
}
Merhaba dunya!
Merhaba dunya!
Merhaba dunya!
Merhaba dunya!
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Ekrana gercekten \\n yazdirmak icin\n");
printf("cift slash \\\\ kullanılır");
return 0;
}
Ekrana gercekten \n yazdirmak icin
cift slash \\ kullanılır
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("***");
printf("* *");
printf("***");
return 0;
}
**** ****
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("***\n");
printf("* *\n");
printf("***\n");
return 0;
}
***
* *
***
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("***\n* *\n***\n");
return 0;
}
***
* *
***
#include <stdio.h>
int main(int argc, char *argv[]) {
int a;
int b;
int c;
a=10;
b=20;
c=a+b;
printf("a degiskeninin degeri: %d",a);
printf("b degiskeninin degeri: %d",b);
printf("c degiskeninin degeri: %d",c);
return 0;
}
a degiskeninin degeri: 10b degiskeninin degeri: 20c degiskeninin degeri: 30
#include <stdio.h>
int main(int argc, char *argv[]) {
int a;
int b;
int c;
a=10;
b=20;
c=a+b;
printf("a degiskeninin degeri: %d\n",a);
printf("b degiskeninin degeri: %d\n",b);
printf("c degiskeninin degeri: %d\n",c);
return 0;
}
a degiskeninin degeri: 10
b degiskeninin degeri: 20
c degiskeninin degeri: 30
#include <stdio.h>
int main(int argc, char *argv[]) {
int a;
int b;
int c;
a=10;
b=20;
c=a+b;
printf("a degiskeninin degeri: %d\nb degiskeninin degeri: %d\nc degiskeninin degeri: %d\n",a,b,c);
return 0;
}
a degiskeninin degeri: 10
b degiskeninin degeri: 20
c degiskeninin degeri: 30
#include <stdio.h>
int main(int argc, char *argv[]) {
int a, b, c;
a=10;
b=20;
c=a+b;
printf("a degiskeninin degeri: %d\nb degiskeninin degeri: %d\nc degiskeninin degeri: %d\n",a,b,c);
return 0;
}
a degiskeninin degeri: 10
b degiskeninin degeri: 20
c degiskeninin degeri: 30
#include <stdio.h>
int main(int argc, char *argv[]) {
int a=10, b=20, c;
c=a+b;
printf("a degiskeninin degeri: %d\nb degiskeninin degeri: %d\nc degiskeninin degeri: %d\n",a,b,c);
return 0;
}
a degiskeninin degeri: 10
b degiskeninin degeri: 20
c degiskeninin degeri: 30
#include <stdio.h>
int main(int argc, char *argv[]) {int a=10, b=20, c; c=a+b; printf("a degiskeninin degeri: %d\nb degiskeninin degeri: %d\nc degiskeninin degeri: %d\n",a,b,c);return 0;}
a degiskeninin degeri: 10
b degiskeninin degeri: 20
c degiskeninin degeri: 30
#include <stdio.h>
int main(int argc, char *argv[]) {
int a=10, b=20;
printf("a:%d\nb:%d\n2a:%d\n3b:%d\na+b:%d\n3(a+2b):%d",
a,b,2*a,3*b,a+b,3*(a+2*b));
return 0;
}
a:10
b:20
2a:20
3b:60
a+b:30
3(a+2b):150
#include <stdio.h>
int main(int argc, char *argv[]) {
char x=100;
printf("%d\n",x);
printf("%c\n",x);
return 0;
}
100
d
#include <stdio.h>
int main(int argc, char *argv[]) {
char x=100;
printf("%c:%d,%c:%d,%c:%d\n",x,x,x+1,x+1,x+2,x+2);
return 0;
}
d:100,e:101,f:102
#include <stdio.h>
int main(int argc, char *argv[]) {
char x='a';
printf("%c:%d,%c:%d,%c:%d\n",x,x,x+1,x+1,x+2,x+2);
return 0;
}
a:97,b:98,c:99
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("%d\n",'a'-'d');
return 0;
}
-3
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("%d,\n%d, %d",'A'-'a','\n','\t');
return 0;
}
-32,
10, 9
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("char: %d\n", sizeof(char));
printf("unsigned char: %d\n", sizeof(unsigned char));
printf("short: %d\n", sizeof(short)); //short int seklinde de kullanılabilir.
printf("unsigned short: %d\n", sizeof(unsigned short));//unsigned short int
printf("int: %d\n", sizeof(int));
printf("unsigned int: %d\n", sizeof(unsigned int));
printf("long: %d\n", sizeof(long)); //long int seklinde de yazılabilir.
printf("unsigned long: %d\n", sizeof(unsigned long int)); //unsigned long seklinde de yazılabilir.
printf("float: %d\n", sizeof(float));
printf("double: %d\n", sizeof(double));
return 0;
}
char: 1
unsigned char: 1
short: 2
unsigned short: 2
int: 4
unsigned int: 4
long: 8
unsigned long: 8
float: 4
double: 8
#include <stdio.h>
int main(int argc, char *argv[]) {
int a=12,b=15,c=32;
printf("a+b:%d+%d=%d\n",a,b,a+b);
printf("a-c:%d-%d=%d\n",a,c,a-c);
printf("b*c:%d*%d=%d\n",b,c,b*c);
printf("c/a:%d/%d=%d\n",c,a,c/a);
printf("c%%a:%d%%%d=%d\n",c,a,c%a);
printf("%d=%dx%d+%d\n",c,b,c/b,c%b);
return 0;
}
a+b:12+15=27
a-c:12-32=-20
b*c:15*32=480
c/a:32/12=2
c%a:32%12=8
32=15x2+2