Skip to content

Instantly share code, notes, and snippets.

@SirmaXX
Last active March 25, 2019 17:12
Show Gist options
  • Save SirmaXX/904cfd44c42401ae02e20d61415014c9 to your computer and use it in GitHub Desktop.
Save SirmaXX/904cfd44c42401ae02e20d61415014c9 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, char **argv)
{
int i,k=6,l;
for(i=2;i<=6;i=i+2){
k=6;
for(l=2;l<=4;l++){
printf("l= %d k=%d i=%d\t",i,k,l);
}
k=k-3;
printf("\n");
}
return 0;
}
#elmas
*
* int a,b=0,c,d=0;
for (a =3; a > b; a--)
{
for (c = 3; c >= d;c--)
{
printf("*");
}
d=d-1;
printf("\n");
}
int i,k=0,j,l=0;
for (i = 6; i >= k; i--)
{
for (j = 6; j >= l; j--)
{
printf("*");
}
l=l+1;
printf("\n");
}
#include<stdio.h>
int main(){
//printf("test");
/*
float sayi_1, sayi_2,toplam,carpim,fark,bolum;
printf("birinci sayi");
scanf("%f",&sayi_1);
printf("ikinci sayi");
scanf("%f",&sayi_2);
toplam=sayi_1+sayi_2;
carpim=sayi_1*sayi_2;
fark=sayi_1 - sayi_2;
bolum=sayi_1/sayi_2;
printf("%f ve %f toplam=%f cikarma=%f carpma=%f bolme=%f",sayi_1, sayi_2,toplam,fark,carpim,bolum);
* işlem önceliği
* parantez
*,/,mod
* +-
int number;
printf("lütfen bir sayi giriniz \n");
scanf("%d",&number);
printf("girilen sayi %d\n",number);
int sum;
char letter;
float money;
printf("karakter \n");
scanf("%c",&letter);
getchar();
printf("ondalik para");
scanf("%f",&money);
printf("sum");
scanf("%d",&sum);
printf(" letter : %c money :%f sayi :%d",letter ,money,sum);
ortalam bulan yazılım
int i;
int n;
float sayi;
float toplam=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
printf("%d inci sayi",i);
scanf("%f",&sayi);
toplam=toplam+sayi;
}
printf("%.2f",toplam/n);
int i=0;
int k=5;
while (i<=k)
{
printf("%d. inci sayi",i);
i++;
}
int i=0;
int k=0;
while (i<=10)
{ k=k+2;
i++;
printf("%d. inci sayi islem sonucu:%d\n",i,k);
}
int i=0;
int k=0;
do
{ k=k+2;
i++;
printf("%d. inci sayias islem sonucu:%d\n",i,k);
}while (i<=10);
int k=6,i,tk=0,ti=0;
while (k >=1)
{
for (i = 1; i < k; i++)
{
printf("*");
ti=ti+i;
}
printf("\t%d",ti);
ti=0;
printf("\n");
tk=tk+k;
k--;
}
printf("%d\n",tk);
int i=0,j=0;
do{
printf("%d\t %d\t %d\n",i,i*i,i+i);
i++;
}while(i<10);
return 0;
}
int i=0,j=0;
do{
j++;
do{
i=i+2;
printf("A=%d\t B=%d\n ",i,j);
}while(i<4);
}while(j<3);
int k=3,i=1,j;
do{
printf("Turkiye");
for (j = 0; j <=k; j++)
{
printf("*");
}
for (j = 1; j <=10-k+i; j++)
{
printf("\bC");
}
for (j = 1; j <=k; j++)
{
printf("*");
printf("\nTurkiye");
}
k=k-1;
i=i+1;
}while(k<1);
int k=3,l,j;
for (l = 3; l< 6; l++)
{
for (j = 0; j <=k; j++)
{
printf("%d",k);
}
k=k-1;
printf("\n");
}
int a=5,b,c,d;
b = a++;
printf("%d",a);
printf("%d\n",b);
c = --b;
printf("%d",a);
printf("%d",b);
printf("%d\n",c);
d = (b++)+(c--);
printf("%d",a);
printf("%d",b);
printf("%d",c);
printf("%d\n",d);
*
int sum =12;
int mod=sum % 7;
printf("%d",mod);
* */
int a=6,b=9, c, d, e;
c=b++;
printf("c: %d b:%d\n",c,b);
d=c++;
printf("d:%d c:%d\n",d,c);
e=(--d);
printf("d:%d e:%d\n",d,e);
printf("%d %d\n %d %d %d",a,b,c,d,e);
return 0;
}
homework
#include<stdio.h>
int main()
{
int i;
int n;
float sayi;
float toplam=0;
scanf("%d",&n);
for(i=0;i<=n;i++){
scanf("%f",&sayi);
toplam=toplam+sayi;
}
printf("%.2f",toplam/n);
}
#include<stdio.h>
void main()
{
int i;
int n;
float toplam=0;
scanf("%d",&n);
for(i=1;i<=n;i=i+1){
toplam=toplam+i*i+i+5;
}
printf("%f\n",toplam/n);
}
#include<stdio.h>
void main()
{
int i;
int n;
int toplam=0;
scanf("%d",&n);
for(i=1;i<=n;i=i+1){
toplam=sayi*sayi;
}
printf("%d",toplam);
}
#include<stdio.h>
void main()
{
int sayi;
int limit;
int toplam=0;
printf("lütfen n 'i giriniz");
scanf("%d",&limit);
for(sayi=0;sayi<=limit;sayi=sayi+1){
toplam= sayi*sayi;
printf("%d",toplam);
}
}
#include<stdio.h>
void main()
{
int i=1;
int n;
float sayi;
float toplam=0;
scanf("%d",&n);
while(i<=n){
scanf("%f",&sayi);
toplam=toplam+sayi;
i++;
}
printf("%.2f",toplam/n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment